├── .gitignore ├── AUTHORS ├── CONTACT ├── COPYING ├── ChangeLog ├── FILES ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── aclocal.m4 ├── autogen.sh ├── config.guess ├── config.sub ├── configure ├── configure.ac ├── depcomp ├── dhcp_options.h ├── dhcprobe.8 ├── dhcprobe.c ├── dhcprobe.pod ├── install-sh ├── missing └── mkinstalldirs /.gitignore: -------------------------------------------------------------------------------- 1 | config.log 2 | Makefile 3 | config.status 4 | *~ 5 | dhcping 6 | *.o 7 | .deps 8 | compile 9 | autom4te.cache/ 10 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Original Author: Edwin Groothuis (dhping, http://www.mavetju.org/) 2 | Maintainer of dhcprobe: Johannes Buchner 3 | 4 | -------------------------------------------------------------------------------- /CONTACT: -------------------------------------------------------------------------------- 1 | HOW TO CONTACT 2 | 3 | Via email: buchner.johannes@gmx.at 4 | 5 | 6 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2000, 2001, 2002 Edwin Groothuis, edwin@mavetju.org 3 | Copyright (c) 2012 Johannes Buchner, buchner.johannes@gmx.at 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | $Id: CHANGES,v 1.2 2002/01/27 02:08:20 mavetju Exp $ 2 | 3 | version 1.2 4 | - Changed documentation into .pod format 5 | - Added autoconfiguration script 6 | - Fixed linking problems for Solaris/SunOS 7 | 8 | version 1.1 9 | - Added DHCPINFORM option with help from Peter Marschall 10 | 11 | 12 | version 1.0 13 | - initial release 14 | -------------------------------------------------------------------------------- /FILES: -------------------------------------------------------------------------------- 1 | $Id: FILES,v 1.2 2002/01/27 02:18:36 mavetju Exp $ 2 | 3 | General 4 | ------- 5 | CHANGES - Change log 6 | CONTACT - How to contact me 7 | FILES - This file 8 | LICENSE - License under which this software is distributed 9 | 10 | Auto-configuration 11 | ------------------ 12 | Makefile.am - My Makefile-template 13 | configure.in - My configure-template 14 | Makefile.in - (Created by automake) 15 | aclocal.m4 - (Needed by autoconf) 16 | config.guess - (Needed by configure) 17 | config.sub - (Needed by configure) 18 | configure - Configure-file 19 | depcomp - (Needed by configure) 20 | install-sh - (Needed by configure) 21 | missing - (Needed by configure) 22 | mkinstalldirs - (Needed by configure) 23 | 24 | Source-file 25 | ----------- 26 | dhcp_options.h - Tables with dhcp-packet-field values and their 27 | readable descriptions 28 | dhcping.8 - Man-page, obtained from dhcping.pod 29 | dhcping.c - The source-file 30 | dhcping.pod - The original man-file 31 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | $ ./configure 2 | 3 | $ make 4 | 5 | as superuser: 6 | 7 | $ make install 8 | 9 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = dhcprobe 2 | dhcprobe_SOURCES = dhcprobe.c dhcprobe_options.h 3 | man_MANS = dhcprobe.8 4 | 5 | dhcprobe.8: dhcprobe.pod 6 | $(PERL2MAN_RULE) 7 | PERL2MAN_RULE = \ 8 | pod2man --release="April 7, 2012" --date="April 7, 2012" --center="General Commands Manual" --section=8 $? > $@ 9 | 10 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Makefile.in generated by automake 1.14.1 from Makefile.am. 2 | # @configure_input@ 3 | 4 | # Copyright (C) 1994-2013 Free Software Foundation, Inc. 5 | 6 | # This Makefile.in is free software; the Free Software Foundation 7 | # gives unlimited permission to copy and/or distribute it, 8 | # with or without modifications, as long as this notice is preserved. 9 | 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13 | # PARTICULAR PURPOSE. 14 | 15 | @SET_MAKE@ 16 | 17 | VPATH = @srcdir@ 18 | am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' 19 | am__make_running_with_option = \ 20 | case $${target_option-} in \ 21 | ?) ;; \ 22 | *) echo "am__make_running_with_option: internal error: invalid" \ 23 | "target option '$${target_option-}' specified" >&2; \ 24 | exit 1;; \ 25 | esac; \ 26 | has_opt=no; \ 27 | sane_makeflags=$$MAKEFLAGS; \ 28 | if $(am__is_gnu_make); then \ 29 | sane_makeflags=$$MFLAGS; \ 30 | else \ 31 | case $$MAKEFLAGS in \ 32 | *\\[\ \ ]*) \ 33 | bs=\\; \ 34 | sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ 35 | | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ 36 | esac; \ 37 | fi; \ 38 | skip_next=no; \ 39 | strip_trailopt () \ 40 | { \ 41 | flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ 42 | }; \ 43 | for flg in $$sane_makeflags; do \ 44 | test $$skip_next = yes && { skip_next=no; continue; }; \ 45 | case $$flg in \ 46 | *=*|--*) continue;; \ 47 | -*I) strip_trailopt 'I'; skip_next=yes;; \ 48 | -*I?*) strip_trailopt 'I';; \ 49 | -*O) strip_trailopt 'O'; skip_next=yes;; \ 50 | -*O?*) strip_trailopt 'O';; \ 51 | -*l) strip_trailopt 'l'; skip_next=yes;; \ 52 | -*l?*) strip_trailopt 'l';; \ 53 | -[dEDm]) skip_next=yes;; \ 54 | -[JT]) skip_next=yes;; \ 55 | esac; \ 56 | case $$flg in \ 57 | *$$target_option*) has_opt=yes; break;; \ 58 | esac; \ 59 | done; \ 60 | test $$has_opt = yes 61 | am__make_dryrun = (target_option=n; $(am__make_running_with_option)) 62 | am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 63 | pkgdatadir = $(datadir)/@PACKAGE@ 64 | pkgincludedir = $(includedir)/@PACKAGE@ 65 | pkglibdir = $(libdir)/@PACKAGE@ 66 | pkglibexecdir = $(libexecdir)/@PACKAGE@ 67 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 68 | install_sh_DATA = $(install_sh) -c -m 644 69 | install_sh_PROGRAM = $(install_sh) -c 70 | install_sh_SCRIPT = $(install_sh) -c 71 | INSTALL_HEADER = $(INSTALL_DATA) 72 | transform = $(program_transform_name) 73 | NORMAL_INSTALL = : 74 | PRE_INSTALL = : 75 | POST_INSTALL = : 76 | NORMAL_UNINSTALL = : 77 | PRE_UNINSTALL = : 78 | POST_UNINSTALL = : 79 | build_triplet = @build@ 80 | host_triplet = @host@ 81 | target_triplet = @target@ 82 | bin_PROGRAMS = dhcprobe$(EXEEXT) 83 | subdir = . 84 | DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ 85 | $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ 86 | $(top_srcdir)/configure $(am__configure_deps) mkinstalldirs \ 87 | depcomp COPYING compile config.guess config.sub install-sh \ 88 | missing 89 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 90 | am__aclocal_m4_deps = $(top_srcdir)/configure.ac 91 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ 92 | $(ACLOCAL_M4) 93 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ 94 | configure.lineno config.status.lineno 95 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs 96 | CONFIG_CLEAN_FILES = 97 | CONFIG_CLEAN_VPATH_FILES = 98 | am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man8dir)" 99 | PROGRAMS = $(bin_PROGRAMS) 100 | am_dhcprobe_OBJECTS = dhcprobe.$(OBJEXT) 101 | dhcprobe_OBJECTS = $(am_dhcprobe_OBJECTS) 102 | dhcprobe_LDADD = $(LDADD) 103 | AM_V_P = $(am__v_P_@AM_V@) 104 | am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) 105 | am__v_P_0 = false 106 | am__v_P_1 = : 107 | AM_V_GEN = $(am__v_GEN_@AM_V@) 108 | am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 109 | am__v_GEN_0 = @echo " GEN " $@; 110 | am__v_GEN_1 = 111 | AM_V_at = $(am__v_at_@AM_V@) 112 | am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) 113 | am__v_at_0 = @ 114 | am__v_at_1 = 115 | DEFAULT_INCLUDES = -I.@am__isrc@ 116 | depcomp = $(SHELL) $(top_srcdir)/depcomp 117 | am__depfiles_maybe = depfiles 118 | am__mv = mv -f 119 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ 120 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 121 | AM_V_CC = $(am__v_CC_@AM_V@) 122 | am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) 123 | am__v_CC_0 = @echo " CC " $@; 124 | am__v_CC_1 = 125 | CCLD = $(CC) 126 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 127 | AM_V_CCLD = $(am__v_CCLD_@AM_V@) 128 | am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) 129 | am__v_CCLD_0 = @echo " CCLD " $@; 130 | am__v_CCLD_1 = 131 | SOURCES = $(dhcprobe_SOURCES) 132 | DIST_SOURCES = $(dhcprobe_SOURCES) 133 | am__can_run_installinfo = \ 134 | case $$AM_UPDATE_INFO_DIR in \ 135 | n|no|NO) false;; \ 136 | *) (install-info --version) >/dev/null 2>&1;; \ 137 | esac 138 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 139 | am__vpath_adj = case $$p in \ 140 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 141 | *) f=$$p;; \ 142 | esac; 143 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; 144 | am__install_max = 40 145 | am__nobase_strip_setup = \ 146 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` 147 | am__nobase_strip = \ 148 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" 149 | am__nobase_list = $(am__nobase_strip_setup); \ 150 | for p in $$list; do echo "$$p $$p"; done | \ 151 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ 152 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ 153 | if (++n[$$2] == $(am__install_max)) \ 154 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ 155 | END { for (dir in files) print dir, files[dir] }' 156 | am__base_list = \ 157 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 158 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 159 | am__uninstall_files_from_dir = { \ 160 | test -z "$$files" \ 161 | || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ 162 | || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ 163 | $(am__cd) "$$dir" && rm -f $$files; }; \ 164 | } 165 | man8dir = $(mandir)/man8 166 | NROFF = nroff 167 | MANS = $(man_MANS) 168 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 169 | # Read a list of newline-separated strings from the standard input, 170 | # and print each of them once, without duplicates. Input order is 171 | # *not* preserved. 172 | am__uniquify_input = $(AWK) '\ 173 | BEGIN { nonempty = 0; } \ 174 | { items[$$0] = 1; nonempty = 1; } \ 175 | END { if (nonempty) { for (i in items) print i; }; } \ 176 | ' 177 | # Make sure the list of sources is unique. This is necessary because, 178 | # e.g., the same source file might be shared among _SOURCES variables 179 | # for different programs/libraries. 180 | am__define_uniq_tagged_files = \ 181 | list='$(am__tagged_files)'; \ 182 | unique=`for i in $$list; do \ 183 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ 184 | done | $(am__uniquify_input)` 185 | ETAGS = etags 186 | CTAGS = ctags 187 | CSCOPE = cscope 188 | AM_RECURSIVE_TARGETS = cscope 189 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 190 | distdir = $(PACKAGE)-$(VERSION) 191 | top_distdir = $(distdir) 192 | am__remove_distdir = \ 193 | if test -d "$(distdir)"; then \ 194 | find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ 195 | && rm -rf "$(distdir)" \ 196 | || { sleep 5 && rm -rf "$(distdir)"; }; \ 197 | else :; fi 198 | am__post_remove_distdir = $(am__remove_distdir) 199 | DIST_ARCHIVES = $(distdir).tar.gz 200 | GZIP_ENV = --best 201 | DIST_TARGETS = dist-gzip 202 | distuninstallcheck_listfiles = find . -type f -print 203 | am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ 204 | | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' 205 | distcleancheck_listfiles = find . -type f -print 206 | ACLOCAL = @ACLOCAL@ 207 | AMTAR = @AMTAR@ 208 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ 209 | AUTOCONF = @AUTOCONF@ 210 | AUTOHEADER = @AUTOHEADER@ 211 | AUTOMAKE = @AUTOMAKE@ 212 | AWK = @AWK@ 213 | CC = @CC@ 214 | CCDEPMODE = @CCDEPMODE@ 215 | CFLAGS = @CFLAGS@ 216 | CPP = @CPP@ 217 | CPPFLAGS = @CPPFLAGS@ 218 | CYGPATH_W = @CYGPATH_W@ 219 | DEFS = @DEFS@ 220 | DEPDIR = @DEPDIR@ 221 | ECHO_C = @ECHO_C@ 222 | ECHO_N = @ECHO_N@ 223 | ECHO_T = @ECHO_T@ 224 | EGREP = @EGREP@ 225 | EXEEXT = @EXEEXT@ 226 | GREP = @GREP@ 227 | INSTALL = @INSTALL@ 228 | INSTALL_DATA = @INSTALL_DATA@ 229 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ 230 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ 231 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 232 | LDFLAGS = @LDFLAGS@ 233 | LIBOBJS = @LIBOBJS@ 234 | LIBS = @LIBS@ 235 | LTLIBOBJS = @LTLIBOBJS@ 236 | MAKEINFO = @MAKEINFO@ 237 | MKDIR_P = @MKDIR_P@ 238 | OBJEXT = @OBJEXT@ 239 | OS_OPT = @OS_OPT@ 240 | PACKAGE = @PACKAGE@ 241 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ 242 | PACKAGE_NAME = @PACKAGE_NAME@ 243 | PACKAGE_STRING = @PACKAGE_STRING@ 244 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ 245 | PACKAGE_URL = @PACKAGE_URL@ 246 | PACKAGE_VERSION = @PACKAGE_VERSION@ 247 | PATH_SEPARATOR = @PATH_SEPARATOR@ 248 | SET_MAKE = @SET_MAKE@ 249 | SHELL = @SHELL@ 250 | STRIP = @STRIP@ 251 | VERSION = @VERSION@ 252 | abs_builddir = @abs_builddir@ 253 | abs_srcdir = @abs_srcdir@ 254 | abs_top_builddir = @abs_top_builddir@ 255 | abs_top_srcdir = @abs_top_srcdir@ 256 | ac_ct_CC = @ac_ct_CC@ 257 | am__include = @am__include@ 258 | am__leading_dot = @am__leading_dot@ 259 | am__quote = @am__quote@ 260 | am__tar = @am__tar@ 261 | am__untar = @am__untar@ 262 | bindir = @bindir@ 263 | build = @build@ 264 | build_alias = @build_alias@ 265 | build_cpu = @build_cpu@ 266 | build_os = @build_os@ 267 | build_vendor = @build_vendor@ 268 | builddir = @builddir@ 269 | datadir = @datadir@ 270 | datarootdir = @datarootdir@ 271 | docdir = @docdir@ 272 | dvidir = @dvidir@ 273 | exec_prefix = @exec_prefix@ 274 | host = @host@ 275 | host_alias = @host_alias@ 276 | host_cpu = @host_cpu@ 277 | host_os = @host_os@ 278 | host_vendor = @host_vendor@ 279 | htmldir = @htmldir@ 280 | includedir = @includedir@ 281 | infodir = @infodir@ 282 | install_sh = @install_sh@ 283 | libdir = @libdir@ 284 | libexecdir = @libexecdir@ 285 | localedir = @localedir@ 286 | localstatedir = @localstatedir@ 287 | mandir = @mandir@ 288 | mkdir_p = @mkdir_p@ 289 | oldincludedir = @oldincludedir@ 290 | pdfdir = @pdfdir@ 291 | prefix = @prefix@ 292 | program_transform_name = @program_transform_name@ 293 | psdir = @psdir@ 294 | sbindir = @sbindir@ 295 | sharedstatedir = @sharedstatedir@ 296 | srcdir = @srcdir@ 297 | sysconfdir = @sysconfdir@ 298 | target = @target@ 299 | target_alias = @target_alias@ 300 | target_cpu = @target_cpu@ 301 | target_os = @target_os@ 302 | target_vendor = @target_vendor@ 303 | top_build_prefix = @top_build_prefix@ 304 | top_builddir = @top_builddir@ 305 | top_srcdir = @top_srcdir@ 306 | dhcprobe_SOURCES = dhcprobe.c dhcprobe_options.h 307 | man_MANS = dhcprobe.8 308 | PERL2MAN_RULE = \ 309 | pod2man --release="April 7, 2012" --date="April 7, 2012" --center="General Commands Manual" --section=8 $? > $@ 310 | 311 | all: all-am 312 | 313 | .SUFFIXES: 314 | .SUFFIXES: .c .o .obj 315 | am--refresh: Makefile 316 | @: 317 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) 318 | @for dep in $?; do \ 319 | case '$(am__configure_deps)' in \ 320 | *$$dep*) \ 321 | echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ 322 | $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ 323 | && exit 0; \ 324 | exit 1;; \ 325 | esac; \ 326 | done; \ 327 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ 328 | $(am__cd) $(top_srcdir) && \ 329 | $(AUTOMAKE) --gnu Makefile 330 | .PRECIOUS: Makefile 331 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 332 | @case '$?' in \ 333 | *config.status*) \ 334 | echo ' $(SHELL) ./config.status'; \ 335 | $(SHELL) ./config.status;; \ 336 | *) \ 337 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ 338 | cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ 339 | esac; 340 | 341 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 342 | $(SHELL) ./config.status --recheck 343 | 344 | $(top_srcdir)/configure: $(am__configure_deps) 345 | $(am__cd) $(srcdir) && $(AUTOCONF) 346 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) 347 | $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 348 | $(am__aclocal_m4_deps): 349 | install-binPROGRAMS: $(bin_PROGRAMS) 350 | @$(NORMAL_INSTALL) 351 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 352 | if test -n "$$list"; then \ 353 | echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ 354 | $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ 355 | fi; \ 356 | for p in $$list; do echo "$$p $$p"; done | \ 357 | sed 's/$(EXEEXT)$$//' | \ 358 | while read p p1; do if test -f $$p \ 359 | ; then echo "$$p"; echo "$$p"; else :; fi; \ 360 | done | \ 361 | sed -e 'p;s,.*/,,;n;h' \ 362 | -e 's|.*|.|' \ 363 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ 364 | sed 'N;N;N;s,\n, ,g' | \ 365 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ 366 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ 367 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ 368 | else { print "f", $$3 "/" $$4, $$1; } } \ 369 | END { for (d in files) print "f", d, files[d] }' | \ 370 | while read type dir files; do \ 371 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ 372 | test -z "$$files" || { \ 373 | echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ 374 | $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ 375 | } \ 376 | ; done 377 | 378 | uninstall-binPROGRAMS: 379 | @$(NORMAL_UNINSTALL) 380 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ 381 | files=`for p in $$list; do echo "$$p"; done | \ 382 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ 383 | -e 's/$$/$(EXEEXT)/' \ 384 | `; \ 385 | test -n "$$list" || exit 0; \ 386 | echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ 387 | cd "$(DESTDIR)$(bindir)" && rm -f $$files 388 | 389 | clean-binPROGRAMS: 390 | -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) 391 | 392 | dhcprobe$(EXEEXT): $(dhcprobe_OBJECTS) $(dhcprobe_DEPENDENCIES) $(EXTRA_dhcprobe_DEPENDENCIES) 393 | @rm -f dhcprobe$(EXEEXT) 394 | $(AM_V_CCLD)$(LINK) $(dhcprobe_OBJECTS) $(dhcprobe_LDADD) $(LIBS) 395 | 396 | mostlyclean-compile: 397 | -rm -f *.$(OBJEXT) 398 | 399 | distclean-compile: 400 | -rm -f *.tab.c 401 | 402 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dhcprobe.Po@am__quote@ 403 | 404 | .c.o: 405 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 406 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 407 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 408 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 409 | @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< 410 | 411 | .c.obj: 412 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` 413 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 414 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 415 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 416 | @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 417 | install-man8: $(man_MANS) 418 | @$(NORMAL_INSTALL) 419 | @list1=''; \ 420 | list2='$(man_MANS)'; \ 421 | test -n "$(man8dir)" \ 422 | && test -n "`echo $$list1$$list2`" \ 423 | || exit 0; \ 424 | echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ 425 | $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ 426 | { for i in $$list1; do echo "$$i"; done; \ 427 | if test -n "$$list2"; then \ 428 | for i in $$list2; do echo "$$i"; done \ 429 | | sed -n '/\.8[a-z]*$$/p'; \ 430 | fi; \ 431 | } | while read p; do \ 432 | if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ 433 | echo "$$d$$p"; echo "$$p"; \ 434 | done | \ 435 | sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ 436 | -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ 437 | sed 'N;N;s,\n, ,g' | { \ 438 | list=; while read file base inst; do \ 439 | if test "$$base" = "$$inst"; then list="$$list $$file"; else \ 440 | echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ 441 | $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ 442 | fi; \ 443 | done; \ 444 | for i in $$list; do echo "$$i"; done | $(am__base_list) | \ 445 | while read files; do \ 446 | test -z "$$files" || { \ 447 | echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ 448 | $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ 449 | done; } 450 | 451 | uninstall-man8: 452 | @$(NORMAL_UNINSTALL) 453 | @list=''; test -n "$(man8dir)" || exit 0; \ 454 | files=`{ for i in $$list; do echo "$$i"; done; \ 455 | l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ 456 | sed -n '/\.8[a-z]*$$/p'; \ 457 | } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ 458 | -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ 459 | dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) 460 | 461 | ID: $(am__tagged_files) 462 | $(am__define_uniq_tagged_files); mkid -fID $$unique 463 | tags: tags-am 464 | TAGS: tags 465 | 466 | tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 467 | set x; \ 468 | here=`pwd`; \ 469 | $(am__define_uniq_tagged_files); \ 470 | shift; \ 471 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ 472 | test -n "$$unique" || unique=$$empty_fix; \ 473 | if test $$# -gt 0; then \ 474 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 475 | "$$@" $$unique; \ 476 | else \ 477 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ 478 | $$unique; \ 479 | fi; \ 480 | fi 481 | ctags: ctags-am 482 | 483 | CTAGS: ctags 484 | ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 485 | $(am__define_uniq_tagged_files); \ 486 | test -z "$(CTAGS_ARGS)$$unique" \ 487 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ 488 | $$unique 489 | 490 | GTAGS: 491 | here=`$(am__cd) $(top_builddir) && pwd` \ 492 | && $(am__cd) $(top_srcdir) \ 493 | && gtags -i $(GTAGS_ARGS) "$$here" 494 | cscope: cscope.files 495 | test ! -s cscope.files \ 496 | || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) 497 | clean-cscope: 498 | -rm -f cscope.files 499 | cscope.files: clean-cscope cscopelist 500 | cscopelist: cscopelist-am 501 | 502 | cscopelist-am: $(am__tagged_files) 503 | list='$(am__tagged_files)'; \ 504 | case "$(srcdir)" in \ 505 | [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ 506 | *) sdir=$(subdir)/$(srcdir) ;; \ 507 | esac; \ 508 | for i in $$list; do \ 509 | if test -f "$$i"; then \ 510 | echo "$(subdir)/$$i"; \ 511 | else \ 512 | echo "$$sdir/$$i"; \ 513 | fi; \ 514 | done >> $(top_builddir)/cscope.files 515 | 516 | distclean-tags: 517 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags 518 | -rm -f cscope.out cscope.in.out cscope.po.out cscope.files 519 | 520 | distdir: $(DISTFILES) 521 | $(am__remove_distdir) 522 | test -d "$(distdir)" || mkdir "$(distdir)" 523 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 524 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 525 | list='$(DISTFILES)'; \ 526 | dist_files=`for file in $$list; do echo $$file; done | \ 527 | sed -e "s|^$$srcdirstrip/||;t" \ 528 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ 529 | case $$dist_files in \ 530 | */*) $(MKDIR_P) `echo "$$dist_files" | \ 531 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ 532 | sort -u` ;; \ 533 | esac; \ 534 | for file in $$dist_files; do \ 535 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ 536 | if test -d $$d/$$file; then \ 537 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 538 | if test -d "$(distdir)/$$file"; then \ 539 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 540 | fi; \ 541 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ 542 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ 543 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ 544 | fi; \ 545 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ 546 | else \ 547 | test -f "$(distdir)/$$file" \ 548 | || cp -p $$d/$$file "$(distdir)/$$file" \ 549 | || exit 1; \ 550 | fi; \ 551 | done 552 | -test -n "$(am__skip_mode_fix)" \ 553 | || find "$(distdir)" -type d ! -perm -755 \ 554 | -exec chmod u+rwx,go+rx {} \; -o \ 555 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ 556 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ 557 | ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ 558 | || chmod -R a+r "$(distdir)" 559 | dist-gzip: distdir 560 | tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz 561 | $(am__post_remove_distdir) 562 | 563 | dist-bzip2: distdir 564 | tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 565 | $(am__post_remove_distdir) 566 | 567 | dist-lzip: distdir 568 | tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz 569 | $(am__post_remove_distdir) 570 | 571 | dist-xz: distdir 572 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz 573 | $(am__post_remove_distdir) 574 | 575 | dist-tarZ: distdir 576 | @echo WARNING: "Support for shar distribution archives is" \ 577 | "deprecated." >&2 578 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 579 | tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z 580 | $(am__post_remove_distdir) 581 | 582 | dist-shar: distdir 583 | @echo WARNING: "Support for distribution archives compressed with" \ 584 | "legacy program 'compress' is deprecated." >&2 585 | @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 586 | shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz 587 | $(am__post_remove_distdir) 588 | 589 | dist-zip: distdir 590 | -rm -f $(distdir).zip 591 | zip -rq $(distdir).zip $(distdir) 592 | $(am__post_remove_distdir) 593 | 594 | dist dist-all: 595 | $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' 596 | $(am__post_remove_distdir) 597 | 598 | # This target untars the dist file and tries a VPATH configuration. Then 599 | # it guarantees that the distribution is self-contained by making another 600 | # tarfile. 601 | distcheck: dist 602 | case '$(DIST_ARCHIVES)' in \ 603 | *.tar.gz*) \ 604 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ 605 | *.tar.bz2*) \ 606 | bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ 607 | *.tar.lz*) \ 608 | lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ 609 | *.tar.xz*) \ 610 | xz -dc $(distdir).tar.xz | $(am__untar) ;;\ 611 | *.tar.Z*) \ 612 | uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ 613 | *.shar.gz*) \ 614 | GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ 615 | *.zip*) \ 616 | unzip $(distdir).zip ;;\ 617 | esac 618 | chmod -R a-w $(distdir) 619 | chmod u+w $(distdir) 620 | mkdir $(distdir)/_build $(distdir)/_inst 621 | chmod a-w $(distdir) 622 | test -d $(distdir)/_build || exit 0; \ 623 | dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ 624 | && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ 625 | && am__cwd=`pwd` \ 626 | && $(am__cd) $(distdir)/_build \ 627 | && ../configure \ 628 | $(AM_DISTCHECK_CONFIGURE_FLAGS) \ 629 | $(DISTCHECK_CONFIGURE_FLAGS) \ 630 | --srcdir=.. --prefix="$$dc_install_base" \ 631 | && $(MAKE) $(AM_MAKEFLAGS) \ 632 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ 633 | && $(MAKE) $(AM_MAKEFLAGS) check \ 634 | && $(MAKE) $(AM_MAKEFLAGS) install \ 635 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ 636 | && $(MAKE) $(AM_MAKEFLAGS) uninstall \ 637 | && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ 638 | distuninstallcheck \ 639 | && chmod -R a-w "$$dc_install_base" \ 640 | && ({ \ 641 | (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ 642 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ 643 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ 644 | && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ 645 | distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ 646 | } || { rm -rf "$$dc_destdir"; exit 1; }) \ 647 | && rm -rf "$$dc_destdir" \ 648 | && $(MAKE) $(AM_MAKEFLAGS) dist \ 649 | && rm -rf $(DIST_ARCHIVES) \ 650 | && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ 651 | && cd "$$am__cwd" \ 652 | || exit 1 653 | $(am__post_remove_distdir) 654 | @(echo "$(distdir) archives ready for distribution: "; \ 655 | list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ 656 | sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' 657 | distuninstallcheck: 658 | @test -n '$(distuninstallcheck_dir)' || { \ 659 | echo 'ERROR: trying to run $@ with an empty' \ 660 | '$$(distuninstallcheck_dir)' >&2; \ 661 | exit 1; \ 662 | }; \ 663 | $(am__cd) '$(distuninstallcheck_dir)' || { \ 664 | echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ 665 | exit 1; \ 666 | }; \ 667 | test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ 668 | || { echo "ERROR: files left after uninstall:" ; \ 669 | if test -n "$(DESTDIR)"; then \ 670 | echo " (check DESTDIR support)"; \ 671 | fi ; \ 672 | $(distuninstallcheck_listfiles) ; \ 673 | exit 1; } >&2 674 | distcleancheck: distclean 675 | @if test '$(srcdir)' = . ; then \ 676 | echo "ERROR: distcleancheck can only run from a VPATH build" ; \ 677 | exit 1 ; \ 678 | fi 679 | @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ 680 | || { echo "ERROR: files left in build directory after distclean:" ; \ 681 | $(distcleancheck_listfiles) ; \ 682 | exit 1; } >&2 683 | check-am: all-am 684 | check: check-am 685 | all-am: Makefile $(PROGRAMS) $(MANS) 686 | installdirs: 687 | for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man8dir)"; do \ 688 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 689 | done 690 | install: install-am 691 | install-exec: install-exec-am 692 | install-data: install-data-am 693 | uninstall: uninstall-am 694 | 695 | install-am: all-am 696 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am 697 | 698 | installcheck: installcheck-am 699 | install-strip: 700 | if test -z '$(STRIP)'; then \ 701 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 702 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 703 | install; \ 704 | else \ 705 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ 706 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ 707 | "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ 708 | fi 709 | mostlyclean-generic: 710 | 711 | clean-generic: 712 | 713 | distclean-generic: 714 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) 715 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 716 | 717 | maintainer-clean-generic: 718 | @echo "This command is intended for maintainers to use" 719 | @echo "it deletes files that may require special tools to rebuild." 720 | clean: clean-am 721 | 722 | clean-am: clean-binPROGRAMS clean-generic mostlyclean-am 723 | 724 | distclean: distclean-am 725 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 726 | -rm -rf ./$(DEPDIR) 727 | -rm -f Makefile 728 | distclean-am: clean-am distclean-compile distclean-generic \ 729 | distclean-tags 730 | 731 | dvi: dvi-am 732 | 733 | dvi-am: 734 | 735 | html: html-am 736 | 737 | html-am: 738 | 739 | info: info-am 740 | 741 | info-am: 742 | 743 | install-data-am: install-man 744 | 745 | install-dvi: install-dvi-am 746 | 747 | install-dvi-am: 748 | 749 | install-exec-am: install-binPROGRAMS 750 | 751 | install-html: install-html-am 752 | 753 | install-html-am: 754 | 755 | install-info: install-info-am 756 | 757 | install-info-am: 758 | 759 | install-man: install-man8 760 | 761 | install-pdf: install-pdf-am 762 | 763 | install-pdf-am: 764 | 765 | install-ps: install-ps-am 766 | 767 | install-ps-am: 768 | 769 | installcheck-am: 770 | 771 | maintainer-clean: maintainer-clean-am 772 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) 773 | -rm -rf $(top_srcdir)/autom4te.cache 774 | -rm -rf ./$(DEPDIR) 775 | -rm -f Makefile 776 | maintainer-clean-am: distclean-am maintainer-clean-generic 777 | 778 | mostlyclean: mostlyclean-am 779 | 780 | mostlyclean-am: mostlyclean-compile mostlyclean-generic 781 | 782 | pdf: pdf-am 783 | 784 | pdf-am: 785 | 786 | ps: ps-am 787 | 788 | ps-am: 789 | 790 | uninstall-am: uninstall-binPROGRAMS uninstall-man 791 | 792 | uninstall-man: uninstall-man8 793 | 794 | .MAKE: install-am install-strip 795 | 796 | .PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ 797 | clean-binPROGRAMS clean-cscope clean-generic cscope \ 798 | cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ 799 | dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ 800 | distcheck distclean distclean-compile distclean-generic \ 801 | distclean-tags distcleancheck distdir distuninstallcheck dvi \ 802 | dvi-am html html-am info info-am install install-am \ 803 | install-binPROGRAMS install-data install-data-am install-dvi \ 804 | install-dvi-am install-exec install-exec-am install-html \ 805 | install-html-am install-info install-info-am install-man \ 806 | install-man8 install-pdf install-pdf-am install-ps \ 807 | install-ps-am install-strip installcheck installcheck-am \ 808 | installdirs maintainer-clean maintainer-clean-generic \ 809 | mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ 810 | ps ps-am tags tags-am uninstall uninstall-am \ 811 | uninstall-binPROGRAMS uninstall-man uninstall-man8 812 | 813 | 814 | dhcprobe.8: dhcprobe.pod 815 | $(PERL2MAN_RULE) 816 | 817 | # Tell versions [3.59,3.63) of GNU make to not export all variables. 818 | # Otherwise a system limit (for SysV at least) may be exceeded. 819 | .NOEXPORT: 820 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | April 7, 2012: forked from dhcping 2 | 3 | 4 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | DHCProbe -- send a DHCP request to DHCP server to check its configuration 2 | ========================================================================== 3 | 4 | Using DHCProbe, one can request a lease from a DHCP server, 5 | and dump the result for verifying the configuration. 6 | 7 | Example in verbose mode: 8 | 9 | $ sudo ./dhcprobe -v -s 172.20.205.1 10 | Got answer from: 172.20.205.1 11 | option 53 DHCP message type 6 (DHCPNAK) 12 | option 54 Server identifier 172.20.205.1 13 | option 1 Subnet mask 255.255.255.0 14 | option 3 Router 172.20.205.1 15 | option 15 Domain name slh.local 16 | option 6 DNS server 172.20.200.250 17 | option 51 IP address leasetime 18 | option 58 T1 19 | option 59 T2 20 | 21 | 22 | We can verify that the domain name, DNS server, etc. are configured correctly 23 | in the DHCP server. 24 | 25 | Build Instructions 26 | ------------------ 27 | 28 | ./autogen.sh 29 | ./configure 30 | make 31 | make install 32 | 33 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.14.1 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. 4 | 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 15 | m4_ifndef([AC_AUTOCONF_VERSION], 16 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 17 | m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, 18 | [m4_warning([this file was generated for autoconf 2.69. 19 | You have another version of autoconf. It may work, but is not guaranteed to. 20 | If you have problems, you may need to regenerate the build system entirely. 21 | To do so, use the procedure documented by the package, typically 'autoreconf'.])]) 22 | 23 | # Copyright (C) 2002-2013 Free Software Foundation, Inc. 24 | # 25 | # This file is free software; the Free Software Foundation 26 | # gives unlimited permission to copy and/or distribute it, 27 | # with or without modifications, as long as this notice is preserved. 28 | 29 | # AM_AUTOMAKE_VERSION(VERSION) 30 | # ---------------------------- 31 | # Automake X.Y traces this macro to ensure aclocal.m4 has been 32 | # generated from the m4 files accompanying Automake X.Y. 33 | # (This private macro should not be called outside this file.) 34 | AC_DEFUN([AM_AUTOMAKE_VERSION], 35 | [am__api_version='1.14' 36 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 37 | dnl require some minimum version. Point them to the right macro. 38 | m4_if([$1], [1.14.1], [], 39 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 40 | ]) 41 | 42 | # _AM_AUTOCONF_VERSION(VERSION) 43 | # ----------------------------- 44 | # aclocal traces this macro to find the Autoconf version. 45 | # This is a private macro too. Using m4_define simplifies 46 | # the logic in aclocal, which can simply ignore this definition. 47 | m4_define([_AM_AUTOCONF_VERSION], []) 48 | 49 | # AM_SET_CURRENT_AUTOMAKE_VERSION 50 | # ------------------------------- 51 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 52 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 53 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 54 | [AM_AUTOMAKE_VERSION([1.14.1])dnl 55 | m4_ifndef([AC_AUTOCONF_VERSION], 56 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 57 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 58 | 59 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- 60 | 61 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. 62 | # 63 | # This file is free software; the Free Software Foundation 64 | # gives unlimited permission to copy and/or distribute it, 65 | # with or without modifications, as long as this notice is preserved. 66 | 67 | # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 68 | # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to 69 | # '$srcdir', '$srcdir/..', or '$srcdir/../..'. 70 | # 71 | # Of course, Automake must honor this variable whenever it calls a 72 | # tool from the auxiliary directory. The problem is that $srcdir (and 73 | # therefore $ac_aux_dir as well) can be either absolute or relative, 74 | # depending on how configure is run. This is pretty annoying, since 75 | # it makes $ac_aux_dir quite unusable in subdirectories: in the top 76 | # source directory, any form will work fine, but in subdirectories a 77 | # relative path needs to be adjusted first. 78 | # 79 | # $ac_aux_dir/missing 80 | # fails when called from a subdirectory if $ac_aux_dir is relative 81 | # $top_srcdir/$ac_aux_dir/missing 82 | # fails if $ac_aux_dir is absolute, 83 | # fails when called from a subdirectory in a VPATH build with 84 | # a relative $ac_aux_dir 85 | # 86 | # The reason of the latter failure is that $top_srcdir and $ac_aux_dir 87 | # are both prefixed by $srcdir. In an in-source build this is usually 88 | # harmless because $srcdir is '.', but things will broke when you 89 | # start a VPATH build or use an absolute $srcdir. 90 | # 91 | # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 92 | # iff we strip the leading $srcdir from $ac_aux_dir. That would be: 93 | # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 94 | # and then we would define $MISSING as 95 | # MISSING="\${SHELL} $am_aux_dir/missing" 96 | # This will work as long as MISSING is not called from configure, because 97 | # unfortunately $(top_srcdir) has no meaning in configure. 98 | # However there are other variables, like CC, which are often used in 99 | # configure, and could therefore not use this "fixed" $ac_aux_dir. 100 | # 101 | # Another solution, used here, is to always expand $ac_aux_dir to an 102 | # absolute PATH. The drawback is that using absolute paths prevent a 103 | # configured tree to be moved without reconfiguration. 104 | 105 | AC_DEFUN([AM_AUX_DIR_EXPAND], 106 | [dnl Rely on autoconf to set up CDPATH properly. 107 | AC_PREREQ([2.50])dnl 108 | # expand $ac_aux_dir to an absolute path 109 | am_aux_dir=`cd $ac_aux_dir && pwd` 110 | ]) 111 | 112 | # AM_CONDITIONAL -*- Autoconf -*- 113 | 114 | # Copyright (C) 1997-2013 Free Software Foundation, Inc. 115 | # 116 | # This file is free software; the Free Software Foundation 117 | # gives unlimited permission to copy and/or distribute it, 118 | # with or without modifications, as long as this notice is preserved. 119 | 120 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) 121 | # ------------------------------------- 122 | # Define a conditional. 123 | AC_DEFUN([AM_CONDITIONAL], 124 | [AC_PREREQ([2.52])dnl 125 | m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 126 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 127 | AC_SUBST([$1_TRUE])dnl 128 | AC_SUBST([$1_FALSE])dnl 129 | _AM_SUBST_NOTMAKE([$1_TRUE])dnl 130 | _AM_SUBST_NOTMAKE([$1_FALSE])dnl 131 | m4_define([_AM_COND_VALUE_$1], [$2])dnl 132 | if $2; then 133 | $1_TRUE= 134 | $1_FALSE='#' 135 | else 136 | $1_TRUE='#' 137 | $1_FALSE= 138 | fi 139 | AC_CONFIG_COMMANDS_PRE( 140 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 141 | AC_MSG_ERROR([[conditional "$1" was never defined. 142 | Usually this means the macro was only invoked conditionally.]]) 143 | fi])]) 144 | 145 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. 146 | # 147 | # This file is free software; the Free Software Foundation 148 | # gives unlimited permission to copy and/or distribute it, 149 | # with or without modifications, as long as this notice is preserved. 150 | 151 | 152 | # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be 153 | # written in clear, in which case automake, when reading aclocal.m4, 154 | # will think it sees a *use*, and therefore will trigger all it's 155 | # C support machinery. Also note that it means that autoscan, seeing 156 | # CC etc. in the Makefile, will ask for an AC_PROG_CC use... 157 | 158 | 159 | # _AM_DEPENDENCIES(NAME) 160 | # ---------------------- 161 | # See how the compiler implements dependency checking. 162 | # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". 163 | # We try a few techniques and use that to set a single cache variable. 164 | # 165 | # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 166 | # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 167 | # dependency, and given that the user is not expected to run this macro, 168 | # just rely on AC_PROG_CC. 169 | AC_DEFUN([_AM_DEPENDENCIES], 170 | [AC_REQUIRE([AM_SET_DEPDIR])dnl 171 | AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 172 | AC_REQUIRE([AM_MAKE_INCLUDE])dnl 173 | AC_REQUIRE([AM_DEP_TRACK])dnl 174 | 175 | m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], 176 | [$1], [CXX], [depcc="$CXX" am_compiler_list=], 177 | [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 178 | [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], 179 | [$1], [UPC], [depcc="$UPC" am_compiler_list=], 180 | [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 181 | [depcc="$$1" am_compiler_list=]) 182 | 183 | AC_CACHE_CHECK([dependency style of $depcc], 184 | [am_cv_$1_dependencies_compiler_type], 185 | [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 186 | # We make a subdir and do the tests there. Otherwise we can end up 187 | # making bogus files that we don't know about and never remove. For 188 | # instance it was reported that on HP-UX the gcc test will end up 189 | # making a dummy file named 'D' -- because '-MD' means "put the output 190 | # in D". 191 | rm -rf conftest.dir 192 | mkdir conftest.dir 193 | # Copy depcomp to subdir because otherwise we won't find it if we're 194 | # using a relative directory. 195 | cp "$am_depcomp" conftest.dir 196 | cd conftest.dir 197 | # We will build objects and dependencies in a subdirectory because 198 | # it helps to detect inapplicable dependency modes. For instance 199 | # both Tru64's cc and ICC support -MD to output dependencies as a 200 | # side effect of compilation, but ICC will put the dependencies in 201 | # the current directory while Tru64 will put them in the object 202 | # directory. 203 | mkdir sub 204 | 205 | am_cv_$1_dependencies_compiler_type=none 206 | if test "$am_compiler_list" = ""; then 207 | am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 208 | fi 209 | am__universal=false 210 | m4_case([$1], [CC], 211 | [case " $depcc " in #( 212 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 213 | esac], 214 | [CXX], 215 | [case " $depcc " in #( 216 | *\ -arch\ *\ -arch\ *) am__universal=true ;; 217 | esac]) 218 | 219 | for depmode in $am_compiler_list; do 220 | # Setup a source with many dependencies, because some compilers 221 | # like to wrap large dependency lists on column 80 (with \), and 222 | # we should not choose a depcomp mode which is confused by this. 223 | # 224 | # We need to recreate these files for each test, as the compiler may 225 | # overwrite some of them when testing with obscure command lines. 226 | # This happens at least with the AIX C compiler. 227 | : > sub/conftest.c 228 | for i in 1 2 3 4 5 6; do 229 | echo '#include "conftst'$i'.h"' >> sub/conftest.c 230 | # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 231 | # Solaris 10 /bin/sh. 232 | echo '/* dummy */' > sub/conftst$i.h 233 | done 234 | echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 235 | 236 | # We check with '-c' and '-o' for the sake of the "dashmstdout" 237 | # mode. It turns out that the SunPro C++ compiler does not properly 238 | # handle '-M -o', and we need to detect this. Also, some Intel 239 | # versions had trouble with output in subdirs. 240 | am__obj=sub/conftest.${OBJEXT-o} 241 | am__minus_obj="-o $am__obj" 242 | case $depmode in 243 | gcc) 244 | # This depmode causes a compiler race in universal mode. 245 | test "$am__universal" = false || continue 246 | ;; 247 | nosideeffect) 248 | # After this tag, mechanisms are not by side-effect, so they'll 249 | # only be used when explicitly requested. 250 | if test "x$enable_dependency_tracking" = xyes; then 251 | continue 252 | else 253 | break 254 | fi 255 | ;; 256 | msvc7 | msvc7msys | msvisualcpp | msvcmsys) 257 | # This compiler won't grok '-c -o', but also, the minuso test has 258 | # not run yet. These depmodes are late enough in the game, and 259 | # so weak that their functioning should not be impacted. 260 | am__obj=conftest.${OBJEXT-o} 261 | am__minus_obj= 262 | ;; 263 | none) break ;; 264 | esac 265 | if depmode=$depmode \ 266 | source=sub/conftest.c object=$am__obj \ 267 | depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 268 | $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 269 | >/dev/null 2>conftest.err && 270 | grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 271 | grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 272 | grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 273 | ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 274 | # icc doesn't choke on unknown options, it will just issue warnings 275 | # or remarks (even with -Werror). So we grep stderr for any message 276 | # that says an option was ignored or not supported. 277 | # When given -MP, icc 7.0 and 7.1 complain thusly: 278 | # icc: Command line warning: ignoring option '-M'; no argument required 279 | # The diagnosis changed in icc 8.0: 280 | # icc: Command line remark: option '-MP' not supported 281 | if (grep 'ignoring option' conftest.err || 282 | grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 283 | am_cv_$1_dependencies_compiler_type=$depmode 284 | break 285 | fi 286 | fi 287 | done 288 | 289 | cd .. 290 | rm -rf conftest.dir 291 | else 292 | am_cv_$1_dependencies_compiler_type=none 293 | fi 294 | ]) 295 | AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 296 | AM_CONDITIONAL([am__fastdep$1], [ 297 | test "x$enable_dependency_tracking" != xno \ 298 | && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 299 | ]) 300 | 301 | 302 | # AM_SET_DEPDIR 303 | # ------------- 304 | # Choose a directory name for dependency files. 305 | # This macro is AC_REQUIREd in _AM_DEPENDENCIES. 306 | AC_DEFUN([AM_SET_DEPDIR], 307 | [AC_REQUIRE([AM_SET_LEADING_DOT])dnl 308 | AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 309 | ]) 310 | 311 | 312 | # AM_DEP_TRACK 313 | # ------------ 314 | AC_DEFUN([AM_DEP_TRACK], 315 | [AC_ARG_ENABLE([dependency-tracking], [dnl 316 | AS_HELP_STRING( 317 | [--enable-dependency-tracking], 318 | [do not reject slow dependency extractors]) 319 | AS_HELP_STRING( 320 | [--disable-dependency-tracking], 321 | [speeds up one-time build])]) 322 | if test "x$enable_dependency_tracking" != xno; then 323 | am_depcomp="$ac_aux_dir/depcomp" 324 | AMDEPBACKSLASH='\' 325 | am__nodep='_no' 326 | fi 327 | AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 328 | AC_SUBST([AMDEPBACKSLASH])dnl 329 | _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 330 | AC_SUBST([am__nodep])dnl 331 | _AM_SUBST_NOTMAKE([am__nodep])dnl 332 | ]) 333 | 334 | # Generate code to set up dependency tracking. -*- Autoconf -*- 335 | 336 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. 337 | # 338 | # This file is free software; the Free Software Foundation 339 | # gives unlimited permission to copy and/or distribute it, 340 | # with or without modifications, as long as this notice is preserved. 341 | 342 | 343 | # _AM_OUTPUT_DEPENDENCY_COMMANDS 344 | # ------------------------------ 345 | AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 346 | [{ 347 | # Older Autoconf quotes --file arguments for eval, but not when files 348 | # are listed without --file. Let's play safe and only enable the eval 349 | # if we detect the quoting. 350 | case $CONFIG_FILES in 351 | *\'*) eval set x "$CONFIG_FILES" ;; 352 | *) set x $CONFIG_FILES ;; 353 | esac 354 | shift 355 | for mf 356 | do 357 | # Strip MF so we end up with the name of the file. 358 | mf=`echo "$mf" | sed -e 's/:.*$//'` 359 | # Check whether this is an Automake generated Makefile or not. 360 | # We used to match only the files named 'Makefile.in', but 361 | # some people rename them; so instead we look at the file content. 362 | # Grep'ing the first line is not enough: some people post-process 363 | # each Makefile.in and add a new line on top of each file to say so. 364 | # Grep'ing the whole file is not good either: AIX grep has a line 365 | # limit of 2048, but all sed's we know have understand at least 4000. 366 | if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 367 | dirpart=`AS_DIRNAME("$mf")` 368 | else 369 | continue 370 | fi 371 | # Extract the definition of DEPDIR, am__include, and am__quote 372 | # from the Makefile without running 'make'. 373 | DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 374 | test -z "$DEPDIR" && continue 375 | am__include=`sed -n 's/^am__include = //p' < "$mf"` 376 | test -z "$am__include" && continue 377 | am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 378 | # Find all dependency output files, they are included files with 379 | # $(DEPDIR) in their names. We invoke sed twice because it is the 380 | # simplest approach to changing $(DEPDIR) to its actual value in the 381 | # expansion. 382 | for file in `sed -n " 383 | s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 384 | sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do 385 | # Make sure the directory exists. 386 | test -f "$dirpart/$file" && continue 387 | fdir=`AS_DIRNAME(["$file"])` 388 | AS_MKDIR_P([$dirpart/$fdir]) 389 | # echo "creating $dirpart/$file" 390 | echo '# dummy' > "$dirpart/$file" 391 | done 392 | done 393 | } 394 | ])# _AM_OUTPUT_DEPENDENCY_COMMANDS 395 | 396 | 397 | # AM_OUTPUT_DEPENDENCY_COMMANDS 398 | # ----------------------------- 399 | # This macro should only be invoked once -- use via AC_REQUIRE. 400 | # 401 | # This code is only required when automatic dependency tracking 402 | # is enabled. FIXME. This creates each '.P' file that we will 403 | # need in order to bootstrap the dependency handling code. 404 | AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 405 | [AC_CONFIG_COMMANDS([depfiles], 406 | [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 407 | [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 408 | ]) 409 | 410 | # Do all the work for Automake. -*- Autoconf -*- 411 | 412 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. 413 | # 414 | # This file is free software; the Free Software Foundation 415 | # gives unlimited permission to copy and/or distribute it, 416 | # with or without modifications, as long as this notice is preserved. 417 | 418 | # This macro actually does too much. Some checks are only needed if 419 | # your package does certain things. But this isn't really a big deal. 420 | 421 | dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. 422 | m4_define([AC_PROG_CC], 423 | m4_defn([AC_PROG_CC]) 424 | [_AM_PROG_CC_C_O 425 | ]) 426 | 427 | # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 428 | # AM_INIT_AUTOMAKE([OPTIONS]) 429 | # ----------------------------------------------- 430 | # The call with PACKAGE and VERSION arguments is the old style 431 | # call (pre autoconf-2.50), which is being phased out. PACKAGE 432 | # and VERSION should now be passed to AC_INIT and removed from 433 | # the call to AM_INIT_AUTOMAKE. 434 | # We support both call styles for the transition. After 435 | # the next Automake release, Autoconf can make the AC_INIT 436 | # arguments mandatory, and then we can depend on a new Autoconf 437 | # release and drop the old call support. 438 | AC_DEFUN([AM_INIT_AUTOMAKE], 439 | [AC_PREREQ([2.65])dnl 440 | dnl Autoconf wants to disallow AM_ names. We explicitly allow 441 | dnl the ones we care about. 442 | m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 443 | AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 444 | AC_REQUIRE([AC_PROG_INSTALL])dnl 445 | if test "`cd $srcdir && pwd`" != "`pwd`"; then 446 | # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 447 | # is not polluted with repeated "-I." 448 | AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 449 | # test to see if srcdir already configured 450 | if test -f $srcdir/config.status; then 451 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 452 | fi 453 | fi 454 | 455 | # test whether we have cygpath 456 | if test -z "$CYGPATH_W"; then 457 | if (cygpath --version) >/dev/null 2>/dev/null; then 458 | CYGPATH_W='cygpath -w' 459 | else 460 | CYGPATH_W=echo 461 | fi 462 | fi 463 | AC_SUBST([CYGPATH_W]) 464 | 465 | # Define the identity of the package. 466 | dnl Distinguish between old-style and new-style calls. 467 | m4_ifval([$2], 468 | [AC_DIAGNOSE([obsolete], 469 | [$0: two- and three-arguments forms are deprecated.]) 470 | m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 471 | AC_SUBST([PACKAGE], [$1])dnl 472 | AC_SUBST([VERSION], [$2])], 473 | [_AM_SET_OPTIONS([$1])dnl 474 | dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 475 | m4_if( 476 | m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), 477 | [ok:ok],, 478 | [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 479 | AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 480 | AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 481 | 482 | _AM_IF_OPTION([no-define],, 483 | [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) 484 | AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl 485 | 486 | # Some tools Automake needs. 487 | AC_REQUIRE([AM_SANITY_CHECK])dnl 488 | AC_REQUIRE([AC_ARG_PROGRAM])dnl 489 | AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) 490 | AM_MISSING_PROG([AUTOCONF], [autoconf]) 491 | AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) 492 | AM_MISSING_PROG([AUTOHEADER], [autoheader]) 493 | AM_MISSING_PROG([MAKEINFO], [makeinfo]) 494 | AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 495 | AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 496 | AC_REQUIRE([AC_PROG_MKDIR_P])dnl 497 | # For better backward compatibility. To be removed once Automake 1.9.x 498 | # dies out for good. For more background, see: 499 | # 500 | # 501 | AC_SUBST([mkdir_p], ['$(MKDIR_P)']) 502 | # We need awk for the "check" target. The system "awk" is bad on 503 | # some platforms. 504 | AC_REQUIRE([AC_PROG_AWK])dnl 505 | AC_REQUIRE([AC_PROG_MAKE_SET])dnl 506 | AC_REQUIRE([AM_SET_LEADING_DOT])dnl 507 | _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 508 | [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 509 | [_AM_PROG_TAR([v7])])]) 510 | _AM_IF_OPTION([no-dependencies],, 511 | [AC_PROVIDE_IFELSE([AC_PROG_CC], 512 | [_AM_DEPENDENCIES([CC])], 513 | [m4_define([AC_PROG_CC], 514 | m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl 515 | AC_PROVIDE_IFELSE([AC_PROG_CXX], 516 | [_AM_DEPENDENCIES([CXX])], 517 | [m4_define([AC_PROG_CXX], 518 | m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl 519 | AC_PROVIDE_IFELSE([AC_PROG_OBJC], 520 | [_AM_DEPENDENCIES([OBJC])], 521 | [m4_define([AC_PROG_OBJC], 522 | m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl 523 | AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], 524 | [_AM_DEPENDENCIES([OBJCXX])], 525 | [m4_define([AC_PROG_OBJCXX], 526 | m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl 527 | ]) 528 | AC_REQUIRE([AM_SILENT_RULES])dnl 529 | dnl The testsuite driver may need to know about EXEEXT, so add the 530 | dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This 531 | dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. 532 | AC_CONFIG_COMMANDS_PRE(dnl 533 | [m4_provide_if([_AM_COMPILER_EXEEXT], 534 | [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 535 | 536 | # POSIX will say in a future version that running "rm -f" with no argument 537 | # is OK; and we want to be able to make that assumption in our Makefile 538 | # recipes. So use an aggressive probe to check that the usage we want is 539 | # actually supported "in the wild" to an acceptable degree. 540 | # See automake bug#10828. 541 | # To make any issue more visible, cause the running configure to be aborted 542 | # by default if the 'rm' program in use doesn't match our expectations; the 543 | # user can still override this though. 544 | if rm -f && rm -fr && rm -rf; then : OK; else 545 | cat >&2 <<'END' 546 | Oops! 547 | 548 | Your 'rm' program seems unable to run without file operands specified 549 | on the command line, even when the '-f' option is present. This is contrary 550 | to the behaviour of most rm programs out there, and not conforming with 551 | the upcoming POSIX standard: 552 | 553 | Please tell bug-automake@gnu.org about your system, including the value 554 | of your $PATH and any error possibly output before this message. This 555 | can help us improve future automake versions. 556 | 557 | END 558 | if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then 559 | echo 'Configuration will proceed anyway, since you have set the' >&2 560 | echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 561 | echo >&2 562 | else 563 | cat >&2 <<'END' 564 | Aborting the configuration process, to ensure you take notice of the issue. 565 | 566 | You can download and install GNU coreutils to get an 'rm' implementation 567 | that behaves properly: . 568 | 569 | If you want to complete the configuration process using your problematic 570 | 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM 571 | to "yes", and re-run configure. 572 | 573 | END 574 | AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) 575 | fi 576 | fi]) 577 | 578 | dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 579 | dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 580 | dnl mangled by Autoconf and run in a shell conditional statement. 581 | m4_define([_AC_COMPILER_EXEEXT], 582 | m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 583 | 584 | # When config.status generates a header, we must update the stamp-h file. 585 | # This file resides in the same directory as the config header 586 | # that is generated. The stamp files are numbered to have different names. 587 | 588 | # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 589 | # loop where config.status creates the headers, so we can generate 590 | # our stamp files there. 591 | AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 592 | [# Compute $1's index in $config_headers. 593 | _am_arg=$1 594 | _am_stamp_count=1 595 | for _am_header in $config_headers :; do 596 | case $_am_header in 597 | $_am_arg | $_am_arg:* ) 598 | break ;; 599 | * ) 600 | _am_stamp_count=`expr $_am_stamp_count + 1` ;; 601 | esac 602 | done 603 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 604 | 605 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. 606 | # 607 | # This file is free software; the Free Software Foundation 608 | # gives unlimited permission to copy and/or distribute it, 609 | # with or without modifications, as long as this notice is preserved. 610 | 611 | # AM_PROG_INSTALL_SH 612 | # ------------------ 613 | # Define $install_sh. 614 | AC_DEFUN([AM_PROG_INSTALL_SH], 615 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 616 | if test x"${install_sh}" != xset; then 617 | case $am_aux_dir in 618 | *\ * | *\ *) 619 | install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 620 | *) 621 | install_sh="\${SHELL} $am_aux_dir/install-sh" 622 | esac 623 | fi 624 | AC_SUBST([install_sh])]) 625 | 626 | # Copyright (C) 2003-2013 Free Software Foundation, Inc. 627 | # 628 | # This file is free software; the Free Software Foundation 629 | # gives unlimited permission to copy and/or distribute it, 630 | # with or without modifications, as long as this notice is preserved. 631 | 632 | # Check whether the underlying file-system supports filenames 633 | # with a leading dot. For instance MS-DOS doesn't. 634 | AC_DEFUN([AM_SET_LEADING_DOT], 635 | [rm -rf .tst 2>/dev/null 636 | mkdir .tst 2>/dev/null 637 | if test -d .tst; then 638 | am__leading_dot=. 639 | else 640 | am__leading_dot=_ 641 | fi 642 | rmdir .tst 2>/dev/null 643 | AC_SUBST([am__leading_dot])]) 644 | 645 | # Check to see how 'make' treats includes. -*- Autoconf -*- 646 | 647 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. 648 | # 649 | # This file is free software; the Free Software Foundation 650 | # gives unlimited permission to copy and/or distribute it, 651 | # with or without modifications, as long as this notice is preserved. 652 | 653 | # AM_MAKE_INCLUDE() 654 | # ----------------- 655 | # Check to see how make treats includes. 656 | AC_DEFUN([AM_MAKE_INCLUDE], 657 | [am_make=${MAKE-make} 658 | cat > confinc << 'END' 659 | am__doit: 660 | @echo this is the am__doit target 661 | .PHONY: am__doit 662 | END 663 | # If we don't find an include directive, just comment out the code. 664 | AC_MSG_CHECKING([for style of include used by $am_make]) 665 | am__include="#" 666 | am__quote= 667 | _am_result=none 668 | # First try GNU make style include. 669 | echo "include confinc" > confmf 670 | # Ignore all kinds of additional output from 'make'. 671 | case `$am_make -s -f confmf 2> /dev/null` in #( 672 | *the\ am__doit\ target*) 673 | am__include=include 674 | am__quote= 675 | _am_result=GNU 676 | ;; 677 | esac 678 | # Now try BSD make style include. 679 | if test "$am__include" = "#"; then 680 | echo '.include "confinc"' > confmf 681 | case `$am_make -s -f confmf 2> /dev/null` in #( 682 | *the\ am__doit\ target*) 683 | am__include=.include 684 | am__quote="\"" 685 | _am_result=BSD 686 | ;; 687 | esac 688 | fi 689 | AC_SUBST([am__include]) 690 | AC_SUBST([am__quote]) 691 | AC_MSG_RESULT([$_am_result]) 692 | rm -f confinc confmf 693 | ]) 694 | 695 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 696 | 697 | # Copyright (C) 1997-2013 Free Software Foundation, Inc. 698 | # 699 | # This file is free software; the Free Software Foundation 700 | # gives unlimited permission to copy and/or distribute it, 701 | # with or without modifications, as long as this notice is preserved. 702 | 703 | # AM_MISSING_PROG(NAME, PROGRAM) 704 | # ------------------------------ 705 | AC_DEFUN([AM_MISSING_PROG], 706 | [AC_REQUIRE([AM_MISSING_HAS_RUN]) 707 | $1=${$1-"${am_missing_run}$2"} 708 | AC_SUBST($1)]) 709 | 710 | # AM_MISSING_HAS_RUN 711 | # ------------------ 712 | # Define MISSING if not defined so far and test if it is modern enough. 713 | # If it is, set am_missing_run to use it, otherwise, to nothing. 714 | AC_DEFUN([AM_MISSING_HAS_RUN], 715 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 716 | AC_REQUIRE_AUX_FILE([missing])dnl 717 | if test x"${MISSING+set}" != xset; then 718 | case $am_aux_dir in 719 | *\ * | *\ *) 720 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 721 | *) 722 | MISSING="\${SHELL} $am_aux_dir/missing" ;; 723 | esac 724 | fi 725 | # Use eval to expand $SHELL 726 | if eval "$MISSING --is-lightweight"; then 727 | am_missing_run="$MISSING " 728 | else 729 | am_missing_run= 730 | AC_MSG_WARN(['missing' script is too old or missing]) 731 | fi 732 | ]) 733 | 734 | # Helper functions for option handling. -*- Autoconf -*- 735 | 736 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. 737 | # 738 | # This file is free software; the Free Software Foundation 739 | # gives unlimited permission to copy and/or distribute it, 740 | # with or without modifications, as long as this notice is preserved. 741 | 742 | # _AM_MANGLE_OPTION(NAME) 743 | # ----------------------- 744 | AC_DEFUN([_AM_MANGLE_OPTION], 745 | [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 746 | 747 | # _AM_SET_OPTION(NAME) 748 | # -------------------- 749 | # Set option NAME. Presently that only means defining a flag for this option. 750 | AC_DEFUN([_AM_SET_OPTION], 751 | [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) 752 | 753 | # _AM_SET_OPTIONS(OPTIONS) 754 | # ------------------------ 755 | # OPTIONS is a space-separated list of Automake options. 756 | AC_DEFUN([_AM_SET_OPTIONS], 757 | [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 758 | 759 | # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 760 | # ------------------------------------------- 761 | # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 762 | AC_DEFUN([_AM_IF_OPTION], 763 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 764 | 765 | # Copyright (C) 1999-2013 Free Software Foundation, Inc. 766 | # 767 | # This file is free software; the Free Software Foundation 768 | # gives unlimited permission to copy and/or distribute it, 769 | # with or without modifications, as long as this notice is preserved. 770 | 771 | # _AM_PROG_CC_C_O 772 | # --------------- 773 | # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC 774 | # to automatically call this. 775 | AC_DEFUN([_AM_PROG_CC_C_O], 776 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 777 | AC_REQUIRE_AUX_FILE([compile])dnl 778 | AC_LANG_PUSH([C])dnl 779 | AC_CACHE_CHECK( 780 | [whether $CC understands -c and -o together], 781 | [am_cv_prog_cc_c_o], 782 | [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) 783 | # Make sure it works both with $CC and with simple cc. 784 | # Following AC_PROG_CC_C_O, we do the test twice because some 785 | # compilers refuse to overwrite an existing .o file with -o, 786 | # though they will create one. 787 | am_cv_prog_cc_c_o=yes 788 | for am_i in 1 2; do 789 | if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ 790 | && test -f conftest2.$ac_objext; then 791 | : OK 792 | else 793 | am_cv_prog_cc_c_o=no 794 | break 795 | fi 796 | done 797 | rm -f core conftest* 798 | unset am_i]) 799 | if test "$am_cv_prog_cc_c_o" != yes; then 800 | # Losing compiler, so override with the script. 801 | # FIXME: It is wrong to rewrite CC. 802 | # But if we don't then we get into trouble of one sort or another. 803 | # A longer-term fix would be to have automake use am__CC in this case, 804 | # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 805 | CC="$am_aux_dir/compile $CC" 806 | fi 807 | AC_LANG_POP([C])]) 808 | 809 | # For backward compatibility. 810 | AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) 811 | 812 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. 813 | # 814 | # This file is free software; the Free Software Foundation 815 | # gives unlimited permission to copy and/or distribute it, 816 | # with or without modifications, as long as this notice is preserved. 817 | 818 | # AM_RUN_LOG(COMMAND) 819 | # ------------------- 820 | # Run COMMAND, save the exit status in ac_status, and log it. 821 | # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) 822 | AC_DEFUN([AM_RUN_LOG], 823 | [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD 824 | ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 825 | ac_status=$? 826 | echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 827 | (exit $ac_status); }]) 828 | 829 | # Check to make sure that the build environment is sane. -*- Autoconf -*- 830 | 831 | # Copyright (C) 1996-2013 Free Software Foundation, Inc. 832 | # 833 | # This file is free software; the Free Software Foundation 834 | # gives unlimited permission to copy and/or distribute it, 835 | # with or without modifications, as long as this notice is preserved. 836 | 837 | # AM_SANITY_CHECK 838 | # --------------- 839 | AC_DEFUN([AM_SANITY_CHECK], 840 | [AC_MSG_CHECKING([whether build environment is sane]) 841 | # Reject unsafe characters in $srcdir or the absolute working directory 842 | # name. Accept space and tab only in the latter. 843 | am_lf=' 844 | ' 845 | case `pwd` in 846 | *[[\\\"\#\$\&\'\`$am_lf]]*) 847 | AC_MSG_ERROR([unsafe absolute working directory name]);; 848 | esac 849 | case $srcdir in 850 | *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 851 | AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; 852 | esac 853 | 854 | # Do 'set' in a subshell so we don't clobber the current shell's 855 | # arguments. Must try -L first in case configure is actually a 856 | # symlink; some systems play weird games with the mod time of symlinks 857 | # (eg FreeBSD returns the mod time of the symlink's containing 858 | # directory). 859 | if ( 860 | am_has_slept=no 861 | for am_try in 1 2; do 862 | echo "timestamp, slept: $am_has_slept" > conftest.file 863 | set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 864 | if test "$[*]" = "X"; then 865 | # -L didn't work. 866 | set X `ls -t "$srcdir/configure" conftest.file` 867 | fi 868 | if test "$[*]" != "X $srcdir/configure conftest.file" \ 869 | && test "$[*]" != "X conftest.file $srcdir/configure"; then 870 | 871 | # If neither matched, then we have a broken ls. This can happen 872 | # if, for instance, CONFIG_SHELL is bash and it inherits a 873 | # broken ls alias from the environment. This has actually 874 | # happened. Such a system could not be considered "sane". 875 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 876 | alias in your environment]) 877 | fi 878 | if test "$[2]" = conftest.file || test $am_try -eq 2; then 879 | break 880 | fi 881 | # Just in case. 882 | sleep 1 883 | am_has_slept=yes 884 | done 885 | test "$[2]" = conftest.file 886 | ) 887 | then 888 | # Ok. 889 | : 890 | else 891 | AC_MSG_ERROR([newly created file is older than distributed files! 892 | Check your system clock]) 893 | fi 894 | AC_MSG_RESULT([yes]) 895 | # If we didn't sleep, we still need to ensure time stamps of config.status and 896 | # generated files are strictly newer. 897 | am_sleep_pid= 898 | if grep 'slept: no' conftest.file >/dev/null 2>&1; then 899 | ( sleep 1 ) & 900 | am_sleep_pid=$! 901 | fi 902 | AC_CONFIG_COMMANDS_PRE( 903 | [AC_MSG_CHECKING([that generated files are newer than configure]) 904 | if test -n "$am_sleep_pid"; then 905 | # Hide warnings about reused PIDs. 906 | wait $am_sleep_pid 2>/dev/null 907 | fi 908 | AC_MSG_RESULT([done])]) 909 | rm -f conftest.file 910 | ]) 911 | 912 | # Copyright (C) 2009-2013 Free Software Foundation, Inc. 913 | # 914 | # This file is free software; the Free Software Foundation 915 | # gives unlimited permission to copy and/or distribute it, 916 | # with or without modifications, as long as this notice is preserved. 917 | 918 | # AM_SILENT_RULES([DEFAULT]) 919 | # -------------------------- 920 | # Enable less verbose build rules; with the default set to DEFAULT 921 | # ("yes" being less verbose, "no" or empty being verbose). 922 | AC_DEFUN([AM_SILENT_RULES], 923 | [AC_ARG_ENABLE([silent-rules], [dnl 924 | AS_HELP_STRING( 925 | [--enable-silent-rules], 926 | [less verbose build output (undo: "make V=1")]) 927 | AS_HELP_STRING( 928 | [--disable-silent-rules], 929 | [verbose build output (undo: "make V=0")])dnl 930 | ]) 931 | case $enable_silent_rules in @%:@ ((( 932 | yes) AM_DEFAULT_VERBOSITY=0;; 933 | no) AM_DEFAULT_VERBOSITY=1;; 934 | *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 935 | esac 936 | dnl 937 | dnl A few 'make' implementations (e.g., NonStop OS and NextStep) 938 | dnl do not support nested variable expansions. 939 | dnl See automake bug#9928 and bug#10237. 940 | am_make=${MAKE-make} 941 | AC_CACHE_CHECK([whether $am_make supports nested variables], 942 | [am_cv_make_support_nested_variables], 943 | [if AS_ECHO([['TRUE=$(BAR$(V)) 944 | BAR0=false 945 | BAR1=true 946 | V=1 947 | am__doit: 948 | @$(TRUE) 949 | .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then 950 | am_cv_make_support_nested_variables=yes 951 | else 952 | am_cv_make_support_nested_variables=no 953 | fi]) 954 | if test $am_cv_make_support_nested_variables = yes; then 955 | dnl Using '$V' instead of '$(V)' breaks IRIX make. 956 | AM_V='$(V)' 957 | AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 958 | else 959 | AM_V=$AM_DEFAULT_VERBOSITY 960 | AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 961 | fi 962 | AC_SUBST([AM_V])dnl 963 | AM_SUBST_NOTMAKE([AM_V])dnl 964 | AC_SUBST([AM_DEFAULT_V])dnl 965 | AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl 966 | AC_SUBST([AM_DEFAULT_VERBOSITY])dnl 967 | AM_BACKSLASH='\' 968 | AC_SUBST([AM_BACKSLASH])dnl 969 | _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 970 | ]) 971 | 972 | # Copyright (C) 2001-2013 Free Software Foundation, Inc. 973 | # 974 | # This file is free software; the Free Software Foundation 975 | # gives unlimited permission to copy and/or distribute it, 976 | # with or without modifications, as long as this notice is preserved. 977 | 978 | # AM_PROG_INSTALL_STRIP 979 | # --------------------- 980 | # One issue with vendor 'install' (even GNU) is that you can't 981 | # specify the program used to strip binaries. This is especially 982 | # annoying in cross-compiling environments, where the build's strip 983 | # is unlikely to handle the host's binaries. 984 | # Fortunately install-sh will honor a STRIPPROG variable, so we 985 | # always use install-sh in "make install-strip", and initialize 986 | # STRIPPROG with the value of the STRIP variable (set by the user). 987 | AC_DEFUN([AM_PROG_INSTALL_STRIP], 988 | [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 989 | # Installed binaries are usually stripped using 'strip' when the user 990 | # run "make install-strip". However 'strip' might not be the right 991 | # tool to use in cross-compilation environments, therefore Automake 992 | # will honor the 'STRIP' environment variable to overrule this program. 993 | dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. 994 | if test "$cross_compiling" != no; then 995 | AC_CHECK_TOOL([STRIP], [strip], :) 996 | fi 997 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 998 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) 999 | 1000 | # Copyright (C) 2006-2013 Free Software Foundation, Inc. 1001 | # 1002 | # This file is free software; the Free Software Foundation 1003 | # gives unlimited permission to copy and/or distribute it, 1004 | # with or without modifications, as long as this notice is preserved. 1005 | 1006 | # _AM_SUBST_NOTMAKE(VARIABLE) 1007 | # --------------------------- 1008 | # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 1009 | # This macro is traced by Automake. 1010 | AC_DEFUN([_AM_SUBST_NOTMAKE]) 1011 | 1012 | # AM_SUBST_NOTMAKE(VARIABLE) 1013 | # -------------------------- 1014 | # Public sister of _AM_SUBST_NOTMAKE. 1015 | AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 1016 | 1017 | # Check how to create a tarball. -*- Autoconf -*- 1018 | 1019 | # Copyright (C) 2004-2013 Free Software Foundation, Inc. 1020 | # 1021 | # This file is free software; the Free Software Foundation 1022 | # gives unlimited permission to copy and/or distribute it, 1023 | # with or without modifications, as long as this notice is preserved. 1024 | 1025 | # _AM_PROG_TAR(FORMAT) 1026 | # -------------------- 1027 | # Check how to create a tarball in format FORMAT. 1028 | # FORMAT should be one of 'v7', 'ustar', or 'pax'. 1029 | # 1030 | # Substitute a variable $(am__tar) that is a command 1031 | # writing to stdout a FORMAT-tarball containing the directory 1032 | # $tardir. 1033 | # tardir=directory && $(am__tar) > result.tar 1034 | # 1035 | # Substitute a variable $(am__untar) that extract such 1036 | # a tarball read from stdin. 1037 | # $(am__untar) < result.tar 1038 | # 1039 | AC_DEFUN([_AM_PROG_TAR], 1040 | [# Always define AMTAR for backward compatibility. Yes, it's still used 1041 | # in the wild :-( We should find a proper way to deprecate it ... 1042 | AC_SUBST([AMTAR], ['$${TAR-tar}']) 1043 | 1044 | # We'll loop over all known methods to create a tar archive until one works. 1045 | _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 1046 | 1047 | m4_if([$1], [v7], 1048 | [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 1049 | 1050 | [m4_case([$1], 1051 | [ustar], 1052 | [# The POSIX 1988 'ustar' format is defined with fixed-size fields. 1053 | # There is notably a 21 bits limit for the UID and the GID. In fact, 1054 | # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 1055 | # and bug#13588). 1056 | am_max_uid=2097151 # 2^21 - 1 1057 | am_max_gid=$am_max_uid 1058 | # The $UID and $GID variables are not portable, so we need to resort 1059 | # to the POSIX-mandated id(1) utility. Errors in the 'id' calls 1060 | # below are definitely unexpected, so allow the users to see them 1061 | # (that is, avoid stderr redirection). 1062 | am_uid=`id -u || echo unknown` 1063 | am_gid=`id -g || echo unknown` 1064 | AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) 1065 | if test $am_uid -le $am_max_uid; then 1066 | AC_MSG_RESULT([yes]) 1067 | else 1068 | AC_MSG_RESULT([no]) 1069 | _am_tools=none 1070 | fi 1071 | AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) 1072 | if test $am_gid -le $am_max_gid; then 1073 | AC_MSG_RESULT([yes]) 1074 | else 1075 | AC_MSG_RESULT([no]) 1076 | _am_tools=none 1077 | fi], 1078 | 1079 | [pax], 1080 | [], 1081 | 1082 | [m4_fatal([Unknown tar format])]) 1083 | 1084 | AC_MSG_CHECKING([how to create a $1 tar archive]) 1085 | 1086 | # Go ahead even if we have the value already cached. We do so because we 1087 | # need to set the values for the 'am__tar' and 'am__untar' variables. 1088 | _am_tools=${am_cv_prog_tar_$1-$_am_tools} 1089 | 1090 | for _am_tool in $_am_tools; do 1091 | case $_am_tool in 1092 | gnutar) 1093 | for _am_tar in tar gnutar gtar; do 1094 | AM_RUN_LOG([$_am_tar --version]) && break 1095 | done 1096 | am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 1097 | am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 1098 | am__untar="$_am_tar -xf -" 1099 | ;; 1100 | plaintar) 1101 | # Must skip GNU tar: if it does not support --format= it doesn't create 1102 | # ustar tarball either. 1103 | (tar --version) >/dev/null 2>&1 && continue 1104 | am__tar='tar chf - "$$tardir"' 1105 | am__tar_='tar chf - "$tardir"' 1106 | am__untar='tar xf -' 1107 | ;; 1108 | pax) 1109 | am__tar='pax -L -x $1 -w "$$tardir"' 1110 | am__tar_='pax -L -x $1 -w "$tardir"' 1111 | am__untar='pax -r' 1112 | ;; 1113 | cpio) 1114 | am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 1115 | am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 1116 | am__untar='cpio -i -H $1 -d' 1117 | ;; 1118 | none) 1119 | am__tar=false 1120 | am__tar_=false 1121 | am__untar=false 1122 | ;; 1123 | esac 1124 | 1125 | # If the value was cached, stop now. We just wanted to have am__tar 1126 | # and am__untar set. 1127 | test -n "${am_cv_prog_tar_$1}" && break 1128 | 1129 | # tar/untar a dummy directory, and stop if the command works. 1130 | rm -rf conftest.dir 1131 | mkdir conftest.dir 1132 | echo GrepMe > conftest.dir/file 1133 | AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1134 | rm -rf conftest.dir 1135 | if test -s conftest.tar; then 1136 | AM_RUN_LOG([$am__untar /dev/null 2>&1 && break 1139 | fi 1140 | done 1141 | rm -rf conftest.dir 1142 | 1143 | AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1144 | AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1145 | 1146 | AC_SUBST([am__tar]) 1147 | AC_SUBST([am__untar]) 1148 | ]) # _AM_PROG_TAR 1149 | 1150 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | aclocal \ 2 | && automake --gnu --add-missing \ 3 | && autoconf 4 | -------------------------------------------------------------------------------- /config.guess: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Attempt to guess a canonical system name. 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 4 | # Free Software Foundation, Inc. 5 | 6 | timestamp='2001-08-21' 7 | 8 | # This file is free software; you can redistribute it and/or modify it 9 | # under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 2 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, but 14 | # WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | # General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 | # 22 | # As a special exception to the GNU General Public License, if you 23 | # distribute this file as part of a program that contains a 24 | # configuration script generated by Autoconf, you may include it under 25 | # the same distribution terms that you use for the rest of that program. 26 | 27 | # Written by Per Bothner . 28 | # Please send patches to . 29 | # 30 | # This script attempts to guess a canonical system name similar to 31 | # config.sub. If it succeeds, it prints the system name on stdout, and 32 | # exits with 0. Otherwise, it exits with 1. 33 | # 34 | # The plan is that this can be called by configure scripts if you 35 | # don't specify an explicit build system type. 36 | 37 | me=`echo "$0" | sed -e 's,.*/,,'` 38 | 39 | usage="\ 40 | Usage: $0 [OPTION] 41 | 42 | Output the configuration name of the system \`$me' is run on. 43 | 44 | Operation modes: 45 | -h, --help print this help, then exit 46 | -t, --time-stamp print date of last modification, then exit 47 | -v, --version print version number, then exit 48 | 49 | Report bugs and patches to ." 50 | 51 | version="\ 52 | GNU config.guess ($timestamp) 53 | 54 | Originally written by Per Bothner. 55 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 56 | Free Software Foundation, Inc. 57 | 58 | This is free software; see the source for copying conditions. There is NO 59 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 60 | 61 | help=" 62 | Try \`$me --help' for more information." 63 | 64 | # Parse command line 65 | while test $# -gt 0 ; do 66 | case $1 in 67 | --time-stamp | --time* | -t ) 68 | echo "$timestamp" ; exit 0 ;; 69 | --version | -v ) 70 | echo "$version" ; exit 0 ;; 71 | --help | --h* | -h ) 72 | echo "$usage"; exit 0 ;; 73 | -- ) # Stop option processing 74 | shift; break ;; 75 | - ) # Use stdin as input. 76 | break ;; 77 | -* ) 78 | echo "$me: invalid option $1$help" >&2 79 | exit 1 ;; 80 | * ) 81 | break ;; 82 | esac 83 | done 84 | 85 | if test $# != 0; then 86 | echo "$me: too many arguments$help" >&2 87 | exit 1 88 | fi 89 | 90 | 91 | dummy=dummy-$$ 92 | trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 93 | 94 | # CC_FOR_BUILD -- compiler used by this script. 95 | # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 96 | # use `HOST_CC' if defined, but it is deprecated. 97 | 98 | set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in 99 | ,,) echo "int dummy(){}" > $dummy.c ; 100 | for c in cc gcc c89 ; do 101 | ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; 102 | if test $? = 0 ; then 103 | CC_FOR_BUILD="$c"; break ; 104 | fi ; 105 | done ; 106 | rm -f $dummy.c $dummy.o $dummy.rel ; 107 | if test x"$CC_FOR_BUILD" = x ; then 108 | CC_FOR_BUILD=no_compiler_found ; 109 | fi 110 | ;; 111 | ,,*) CC_FOR_BUILD=$CC ;; 112 | ,*,*) CC_FOR_BUILD=$HOST_CC ;; 113 | esac' 114 | 115 | # This is needed to find uname on a Pyramid OSx when run in the BSD universe. 116 | # (ghazi@noc.rutgers.edu 1994-08-24) 117 | if (test -f /.attbin/uname) >/dev/null 2>&1 ; then 118 | PATH=$PATH:/.attbin ; export PATH 119 | fi 120 | 121 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 122 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 123 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 124 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 125 | 126 | # Note: order is significant - the case branches are not exclusive. 127 | 128 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 129 | *:NetBSD:*:*) 130 | # Netbsd (nbsd) targets should (where applicable) match one or 131 | # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 132 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 133 | # switched to ELF, *-*-netbsd* would select the old 134 | # object file format. This provides both forward 135 | # compatibility and a consistent mechanism for selecting the 136 | # object file format. 137 | # Determine the machine/vendor (is the vendor relevant). 138 | case "${UNAME_MACHINE}" in 139 | amiga) machine=m68k-unknown ;; 140 | arm32) machine=arm-unknown ;; 141 | atari*) machine=m68k-atari ;; 142 | sun3*) machine=m68k-sun ;; 143 | mac68k) machine=m68k-apple ;; 144 | macppc) machine=powerpc-apple ;; 145 | hp3[0-9][05]) machine=m68k-hp ;; 146 | ibmrt|romp-ibm) machine=romp-ibm ;; 147 | *) machine=${UNAME_MACHINE}-unknown ;; 148 | esac 149 | # The Operating System including object format, if it has switched 150 | # to ELF recently, or will in the future. 151 | case "${UNAME_MACHINE}" in 152 | i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) 153 | eval $set_cc_for_build 154 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 155 | | grep __ELF__ >/dev/null 156 | then 157 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 158 | # Return netbsd for either. FIX? 159 | os=netbsd 160 | else 161 | os=netbsdelf 162 | fi 163 | ;; 164 | *) 165 | os=netbsd 166 | ;; 167 | esac 168 | # The OS release 169 | release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 170 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 171 | # contains redundant information, the shorter form: 172 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 173 | echo "${machine}-${os}${release}" 174 | exit 0 ;; 175 | alpha:OSF1:*:*) 176 | if test $UNAME_RELEASE = "V4.0"; then 177 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 178 | fi 179 | # A Vn.n version is a released version. 180 | # A Tn.n version is a released field test version. 181 | # A Xn.n version is an unreleased experimental baselevel. 182 | # 1.2 uses "1.2" for uname -r. 183 | cat <$dummy.s 184 | .data 185 | \$Lformat: 186 | .byte 37,100,45,37,120,10,0 # "%d-%x\n" 187 | 188 | .text 189 | .globl main 190 | .align 4 191 | .ent main 192 | main: 193 | .frame \$30,16,\$26,0 194 | ldgp \$29,0(\$27) 195 | .prologue 1 196 | .long 0x47e03d80 # implver \$0 197 | lda \$2,-1 198 | .long 0x47e20c21 # amask \$2,\$1 199 | lda \$16,\$Lformat 200 | mov \$0,\$17 201 | not \$1,\$18 202 | jsr \$26,printf 203 | ldgp \$29,0(\$26) 204 | mov 0,\$16 205 | jsr \$26,exit 206 | .end main 207 | EOF 208 | eval $set_cc_for_build 209 | $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null 210 | if test "$?" = 0 ; then 211 | case `./$dummy` in 212 | 0-0) 213 | UNAME_MACHINE="alpha" 214 | ;; 215 | 1-0) 216 | UNAME_MACHINE="alphaev5" 217 | ;; 218 | 1-1) 219 | UNAME_MACHINE="alphaev56" 220 | ;; 221 | 1-101) 222 | UNAME_MACHINE="alphapca56" 223 | ;; 224 | 2-303) 225 | UNAME_MACHINE="alphaev6" 226 | ;; 227 | 2-307) 228 | UNAME_MACHINE="alphaev67" 229 | ;; 230 | 2-1307) 231 | UNAME_MACHINE="alphaev68" 232 | ;; 233 | esac 234 | fi 235 | rm -f $dummy.s $dummy 236 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 237 | exit 0 ;; 238 | Alpha\ *:Windows_NT*:*) 239 | # How do we know it's Interix rather than the generic POSIX subsystem? 240 | # Should we change UNAME_MACHINE based on the output of uname instead 241 | # of the specific Alpha model? 242 | echo alpha-pc-interix 243 | exit 0 ;; 244 | 21064:Windows_NT:50:3) 245 | echo alpha-dec-winnt3.5 246 | exit 0 ;; 247 | Amiga*:UNIX_System_V:4.0:*) 248 | echo m68k-unknown-sysv4 249 | exit 0;; 250 | amiga:OpenBSD:*:*) 251 | echo m68k-unknown-openbsd${UNAME_RELEASE} 252 | exit 0 ;; 253 | *:[Aa]miga[Oo][Ss]:*:*) 254 | echo ${UNAME_MACHINE}-unknown-amigaos 255 | exit 0 ;; 256 | arc64:OpenBSD:*:*) 257 | echo mips64el-unknown-openbsd${UNAME_RELEASE} 258 | exit 0 ;; 259 | arc:OpenBSD:*:*) 260 | echo mipsel-unknown-openbsd${UNAME_RELEASE} 261 | exit 0 ;; 262 | hkmips:OpenBSD:*:*) 263 | echo mips-unknown-openbsd${UNAME_RELEASE} 264 | exit 0 ;; 265 | pmax:OpenBSD:*:*) 266 | echo mipsel-unknown-openbsd${UNAME_RELEASE} 267 | exit 0 ;; 268 | sgi:OpenBSD:*:*) 269 | echo mips-unknown-openbsd${UNAME_RELEASE} 270 | exit 0 ;; 271 | wgrisc:OpenBSD:*:*) 272 | echo mipsel-unknown-openbsd${UNAME_RELEASE} 273 | exit 0 ;; 274 | *:OS/390:*:*) 275 | echo i370-ibm-openedition 276 | exit 0 ;; 277 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 278 | echo arm-acorn-riscix${UNAME_RELEASE} 279 | exit 0;; 280 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 281 | echo hppa1.1-hitachi-hiuxmpp 282 | exit 0;; 283 | Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 284 | # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 285 | if test "`(/bin/universe) 2>/dev/null`" = att ; then 286 | echo pyramid-pyramid-sysv3 287 | else 288 | echo pyramid-pyramid-bsd 289 | fi 290 | exit 0 ;; 291 | NILE*:*:*:dcosx) 292 | echo pyramid-pyramid-svr4 293 | exit 0 ;; 294 | sun4H:SunOS:5.*:*) 295 | echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 296 | exit 0 ;; 297 | sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 298 | echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 299 | exit 0 ;; 300 | i86pc:SunOS:5.*:*) 301 | echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 302 | exit 0 ;; 303 | sun4*:SunOS:6*:*) 304 | # According to config.sub, this is the proper way to canonicalize 305 | # SunOS6. Hard to guess exactly what SunOS6 will be like, but 306 | # it's likely to be more like Solaris than SunOS4. 307 | echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 308 | exit 0 ;; 309 | sun4*:SunOS:*:*) 310 | case "`/usr/bin/arch -k`" in 311 | Series*|S4*) 312 | UNAME_RELEASE=`uname -v` 313 | ;; 314 | esac 315 | # Japanese Language versions have a version number like `4.1.3-JL'. 316 | echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 317 | exit 0 ;; 318 | sun3*:SunOS:*:*) 319 | echo m68k-sun-sunos${UNAME_RELEASE} 320 | exit 0 ;; 321 | sun*:*:4.2BSD:*) 322 | UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 323 | test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 324 | case "`/bin/arch`" in 325 | sun3) 326 | echo m68k-sun-sunos${UNAME_RELEASE} 327 | ;; 328 | sun4) 329 | echo sparc-sun-sunos${UNAME_RELEASE} 330 | ;; 331 | esac 332 | exit 0 ;; 333 | aushp:SunOS:*:*) 334 | echo sparc-auspex-sunos${UNAME_RELEASE} 335 | exit 0 ;; 336 | sparc*:NetBSD:*) 337 | echo `uname -p`-unknown-netbsd${UNAME_RELEASE} 338 | exit 0 ;; 339 | atari*:OpenBSD:*:*) 340 | echo m68k-unknown-openbsd${UNAME_RELEASE} 341 | exit 0 ;; 342 | # The situation for MiNT is a little confusing. The machine name 343 | # can be virtually everything (everything which is not 344 | # "atarist" or "atariste" at least should have a processor 345 | # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 346 | # to the lowercase version "mint" (or "freemint"). Finally 347 | # the system name "TOS" denotes a system which is actually not 348 | # MiNT. But MiNT is downward compatible to TOS, so this should 349 | # be no problem. 350 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 351 | echo m68k-atari-mint${UNAME_RELEASE} 352 | exit 0 ;; 353 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 354 | echo m68k-atari-mint${UNAME_RELEASE} 355 | exit 0 ;; 356 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 357 | echo m68k-atari-mint${UNAME_RELEASE} 358 | exit 0 ;; 359 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 360 | echo m68k-milan-mint${UNAME_RELEASE} 361 | exit 0 ;; 362 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 363 | echo m68k-hades-mint${UNAME_RELEASE} 364 | exit 0 ;; 365 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 366 | echo m68k-unknown-mint${UNAME_RELEASE} 367 | exit 0 ;; 368 | sun3*:OpenBSD:*:*) 369 | echo m68k-unknown-openbsd${UNAME_RELEASE} 370 | exit 0 ;; 371 | mac68k:OpenBSD:*:*) 372 | echo m68k-unknown-openbsd${UNAME_RELEASE} 373 | exit 0 ;; 374 | mvme68k:OpenBSD:*:*) 375 | echo m68k-unknown-openbsd${UNAME_RELEASE} 376 | exit 0 ;; 377 | mvme88k:OpenBSD:*:*) 378 | echo m88k-unknown-openbsd${UNAME_RELEASE} 379 | exit 0 ;; 380 | powerpc:machten:*:*) 381 | echo powerpc-apple-machten${UNAME_RELEASE} 382 | exit 0 ;; 383 | RISC*:Mach:*:*) 384 | echo mips-dec-mach_bsd4.3 385 | exit 0 ;; 386 | RISC*:ULTRIX:*:*) 387 | echo mips-dec-ultrix${UNAME_RELEASE} 388 | exit 0 ;; 389 | VAX*:ULTRIX*:*:*) 390 | echo vax-dec-ultrix${UNAME_RELEASE} 391 | exit 0 ;; 392 | 2020:CLIX:*:* | 2430:CLIX:*:*) 393 | echo clipper-intergraph-clix${UNAME_RELEASE} 394 | exit 0 ;; 395 | mips:*:*:UMIPS | mips:*:*:RISCos) 396 | sed 's/^ //' << EOF >$dummy.c 397 | #ifdef __cplusplus 398 | #include /* for printf() prototype */ 399 | int main (int argc, char *argv[]) { 400 | #else 401 | int main (argc, argv) int argc; char *argv[]; { 402 | #endif 403 | #if defined (host_mips) && defined (MIPSEB) 404 | #if defined (SYSTYPE_SYSV) 405 | printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 406 | #endif 407 | #if defined (SYSTYPE_SVR4) 408 | printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 409 | #endif 410 | #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 411 | printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 412 | #endif 413 | #endif 414 | exit (-1); 415 | } 416 | EOF 417 | eval $set_cc_for_build 418 | $CC_FOR_BUILD $dummy.c -o $dummy \ 419 | && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ 420 | && rm -f $dummy.c $dummy && exit 0 421 | rm -f $dummy.c $dummy 422 | echo mips-mips-riscos${UNAME_RELEASE} 423 | exit 0 ;; 424 | Motorola:PowerMAX_OS:*:*) 425 | echo powerpc-motorola-powermax 426 | exit 0 ;; 427 | Night_Hawk:Power_UNIX:*:*) 428 | echo powerpc-harris-powerunix 429 | exit 0 ;; 430 | m88k:CX/UX:7*:*) 431 | echo m88k-harris-cxux7 432 | exit 0 ;; 433 | m88k:*:4*:R4*) 434 | echo m88k-motorola-sysv4 435 | exit 0 ;; 436 | m88k:*:3*:R3*) 437 | echo m88k-motorola-sysv3 438 | exit 0 ;; 439 | AViiON:dgux:*:*) 440 | # DG/UX returns AViiON for all architectures 441 | UNAME_PROCESSOR=`/usr/bin/uname -p` 442 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 443 | then 444 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 445 | [ ${TARGET_BINARY_INTERFACE}x = x ] 446 | then 447 | echo m88k-dg-dgux${UNAME_RELEASE} 448 | else 449 | echo m88k-dg-dguxbcs${UNAME_RELEASE} 450 | fi 451 | else 452 | echo i586-dg-dgux${UNAME_RELEASE} 453 | fi 454 | exit 0 ;; 455 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) 456 | echo m88k-dolphin-sysv3 457 | exit 0 ;; 458 | M88*:*:R3*:*) 459 | # Delta 88k system running SVR3 460 | echo m88k-motorola-sysv3 461 | exit 0 ;; 462 | XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 463 | echo m88k-tektronix-sysv3 464 | exit 0 ;; 465 | Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 466 | echo m68k-tektronix-bsd 467 | exit 0 ;; 468 | *:IRIX*:*:*) 469 | echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 470 | exit 0 ;; 471 | ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 472 | echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 473 | exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 474 | i*86:AIX:*:*) 475 | echo i386-ibm-aix 476 | exit 0 ;; 477 | ia64:AIX:*:*) 478 | if [ -x /usr/bin/oslevel ] ; then 479 | IBM_REV=`/usr/bin/oslevel` 480 | else 481 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 482 | fi 483 | echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 484 | exit 0 ;; 485 | *:AIX:2:3) 486 | if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 487 | sed 's/^ //' << EOF >$dummy.c 488 | #include 489 | 490 | main() 491 | { 492 | if (!__power_pc()) 493 | exit(1); 494 | puts("powerpc-ibm-aix3.2.5"); 495 | exit(0); 496 | } 497 | EOF 498 | eval $set_cc_for_build 499 | $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 500 | rm -f $dummy.c $dummy 501 | echo rs6000-ibm-aix3.2.5 502 | elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 503 | echo rs6000-ibm-aix3.2.4 504 | else 505 | echo rs6000-ibm-aix3.2 506 | fi 507 | exit 0 ;; 508 | *:AIX:*:[45]) 509 | IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` 510 | if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 511 | IBM_ARCH=rs6000 512 | else 513 | IBM_ARCH=powerpc 514 | fi 515 | if [ -x /usr/bin/oslevel ] ; then 516 | IBM_REV=`/usr/bin/oslevel` 517 | else 518 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 519 | fi 520 | echo ${IBM_ARCH}-ibm-aix${IBM_REV} 521 | exit 0 ;; 522 | *:AIX:*:*) 523 | echo rs6000-ibm-aix 524 | exit 0 ;; 525 | ibmrt:4.4BSD:*|romp-ibm:BSD:*) 526 | echo romp-ibm-bsd4.4 527 | exit 0 ;; 528 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 529 | echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 530 | exit 0 ;; # report: romp-ibm BSD 4.3 531 | *:BOSX:*:*) 532 | echo rs6000-bull-bosx 533 | exit 0 ;; 534 | DPX/2?00:B.O.S.:*:*) 535 | echo m68k-bull-sysv3 536 | exit 0 ;; 537 | 9000/[34]??:4.3bsd:1.*:*) 538 | echo m68k-hp-bsd 539 | exit 0 ;; 540 | hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 541 | echo m68k-hp-bsd4.4 542 | exit 0 ;; 543 | 9000/[34678]??:HP-UX:*:*) 544 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 545 | case "${UNAME_MACHINE}" in 546 | 9000/31? ) HP_ARCH=m68000 ;; 547 | 9000/[34]?? ) HP_ARCH=m68k ;; 548 | 9000/[678][0-9][0-9]) 549 | case "${HPUX_REV}" in 550 | 11.[0-9][0-9]) 551 | if [ -x /usr/bin/getconf ]; then 552 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 553 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 554 | case "${sc_cpu_version}" in 555 | 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 556 | 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 557 | 532) # CPU_PA_RISC2_0 558 | case "${sc_kernel_bits}" in 559 | 32) HP_ARCH="hppa2.0n" ;; 560 | 64) HP_ARCH="hppa2.0w" ;; 561 | esac ;; 562 | esac 563 | fi ;; 564 | esac 565 | if [ "${HP_ARCH}" = "" ]; then 566 | sed 's/^ //' << EOF >$dummy.c 567 | 568 | #define _HPUX_SOURCE 569 | #include 570 | #include 571 | 572 | int main () 573 | { 574 | #if defined(_SC_KERNEL_BITS) 575 | long bits = sysconf(_SC_KERNEL_BITS); 576 | #endif 577 | long cpu = sysconf (_SC_CPU_VERSION); 578 | 579 | switch (cpu) 580 | { 581 | case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 582 | case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 583 | case CPU_PA_RISC2_0: 584 | #if defined(_SC_KERNEL_BITS) 585 | switch (bits) 586 | { 587 | case 64: puts ("hppa2.0w"); break; 588 | case 32: puts ("hppa2.0n"); break; 589 | default: puts ("hppa2.0"); break; 590 | } break; 591 | #else /* !defined(_SC_KERNEL_BITS) */ 592 | puts ("hppa2.0"); break; 593 | #endif 594 | default: puts ("hppa1.0"); break; 595 | } 596 | exit (0); 597 | } 598 | EOF 599 | eval $set_cc_for_build 600 | (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` 601 | if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi 602 | rm -f $dummy.c $dummy 603 | fi ;; 604 | esac 605 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} 606 | exit 0 ;; 607 | ia64:HP-UX:*:*) 608 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 609 | echo ia64-hp-hpux${HPUX_REV} 610 | exit 0 ;; 611 | 3050*:HI-UX:*:*) 612 | sed 's/^ //' << EOF >$dummy.c 613 | #include 614 | int 615 | main () 616 | { 617 | long cpu = sysconf (_SC_CPU_VERSION); 618 | /* The order matters, because CPU_IS_HP_MC68K erroneously returns 619 | true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 620 | results, however. */ 621 | if (CPU_IS_PA_RISC (cpu)) 622 | { 623 | switch (cpu) 624 | { 625 | case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 626 | case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 627 | case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 628 | default: puts ("hppa-hitachi-hiuxwe2"); break; 629 | } 630 | } 631 | else if (CPU_IS_HP_MC68K (cpu)) 632 | puts ("m68k-hitachi-hiuxwe2"); 633 | else puts ("unknown-hitachi-hiuxwe2"); 634 | exit (0); 635 | } 636 | EOF 637 | eval $set_cc_for_build 638 | $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 639 | rm -f $dummy.c $dummy 640 | echo unknown-hitachi-hiuxwe2 641 | exit 0 ;; 642 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 643 | echo hppa1.1-hp-bsd 644 | exit 0 ;; 645 | 9000/8??:4.3bsd:*:*) 646 | echo hppa1.0-hp-bsd 647 | exit 0 ;; 648 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 649 | echo hppa1.0-hp-mpeix 650 | exit 0 ;; 651 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 652 | echo hppa1.1-hp-osf 653 | exit 0 ;; 654 | hp8??:OSF1:*:*) 655 | echo hppa1.0-hp-osf 656 | exit 0 ;; 657 | i*86:OSF1:*:*) 658 | if [ -x /usr/sbin/sysversion ] ; then 659 | echo ${UNAME_MACHINE}-unknown-osf1mk 660 | else 661 | echo ${UNAME_MACHINE}-unknown-osf1 662 | fi 663 | exit 0 ;; 664 | parisc*:Lites*:*:*) 665 | echo hppa1.1-hp-lites 666 | exit 0 ;; 667 | hppa*:OpenBSD:*:*) 668 | echo hppa-unknown-openbsd 669 | exit 0 ;; 670 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 671 | echo c1-convex-bsd 672 | exit 0 ;; 673 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 674 | if getsysinfo -f scalar_acc 675 | then echo c32-convex-bsd 676 | else echo c2-convex-bsd 677 | fi 678 | exit 0 ;; 679 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 680 | echo c34-convex-bsd 681 | exit 0 ;; 682 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 683 | echo c38-convex-bsd 684 | exit 0 ;; 685 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 686 | echo c4-convex-bsd 687 | exit 0 ;; 688 | CRAY*X-MP:*:*:*) 689 | echo xmp-cray-unicos 690 | exit 0 ;; 691 | CRAY*Y-MP:*:*:*) 692 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 693 | exit 0 ;; 694 | CRAY*[A-Z]90:*:*:*) 695 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 696 | | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 697 | -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 698 | -e 's/\.[^.]*$/.X/' 699 | exit 0 ;; 700 | CRAY*TS:*:*:*) 701 | echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 702 | exit 0 ;; 703 | CRAY*T3D:*:*:*) 704 | echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 705 | exit 0 ;; 706 | CRAY*T3E:*:*:*) 707 | echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 708 | exit 0 ;; 709 | CRAY*SV1:*:*:*) 710 | echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 711 | exit 0 ;; 712 | CRAY-2:*:*:*) 713 | echo cray2-cray-unicos 714 | exit 0 ;; 715 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 716 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 717 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 718 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 719 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 720 | exit 0 ;; 721 | hp300:OpenBSD:*:*) 722 | echo m68k-unknown-openbsd${UNAME_RELEASE} 723 | exit 0 ;; 724 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 725 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 726 | exit 0 ;; 727 | sparc*:BSD/OS:*:*) 728 | echo sparc-unknown-bsdi${UNAME_RELEASE} 729 | exit 0 ;; 730 | *:BSD/OS:*:*) 731 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 732 | exit 0 ;; 733 | *:FreeBSD:*:*) 734 | echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 735 | exit 0 ;; 736 | *:OpenBSD:*:*) 737 | echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 738 | exit 0 ;; 739 | i*:CYGWIN*:*) 740 | echo ${UNAME_MACHINE}-pc-cygwin 741 | exit 0 ;; 742 | i*:MINGW*:*) 743 | echo ${UNAME_MACHINE}-pc-mingw32 744 | exit 0 ;; 745 | i*:PW*:*) 746 | echo ${UNAME_MACHINE}-pc-pw32 747 | exit 0 ;; 748 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 749 | # How do we know it's Interix rather than the generic POSIX subsystem? 750 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 751 | # UNAME_MACHINE based on the output of uname instead of i386? 752 | echo i386-pc-interix 753 | exit 0 ;; 754 | i*:UWIN*:*) 755 | echo ${UNAME_MACHINE}-pc-uwin 756 | exit 0 ;; 757 | p*:CYGWIN*:*) 758 | echo powerpcle-unknown-cygwin 759 | exit 0 ;; 760 | prep*:SunOS:5.*:*) 761 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 762 | exit 0 ;; 763 | *:GNU:*:*) 764 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 765 | exit 0 ;; 766 | i*86:Minix:*:*) 767 | echo ${UNAME_MACHINE}-pc-minix 768 | exit 0 ;; 769 | arm*:Linux:*:*) 770 | echo ${UNAME_MACHINE}-unknown-linux-gnu 771 | exit 0 ;; 772 | ia64:Linux:*:*) 773 | echo ${UNAME_MACHINE}-unknown-linux 774 | exit 0 ;; 775 | m68*:Linux:*:*) 776 | echo ${UNAME_MACHINE}-unknown-linux-gnu 777 | exit 0 ;; 778 | mips:Linux:*:*) 779 | case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in 780 | big) echo mips-unknown-linux-gnu && exit 0 ;; 781 | little) echo mipsel-unknown-linux-gnu && exit 0 ;; 782 | esac 783 | ;; 784 | ppc:Linux:*:*) 785 | echo powerpc-unknown-linux-gnu 786 | exit 0 ;; 787 | ppc64:Linux:*:*) 788 | echo powerpc64-unknown-linux-gnu 789 | exit 0 ;; 790 | alpha:Linux:*:*) 791 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 792 | EV5) UNAME_MACHINE=alphaev5 ;; 793 | EV56) UNAME_MACHINE=alphaev56 ;; 794 | PCA56) UNAME_MACHINE=alphapca56 ;; 795 | PCA57) UNAME_MACHINE=alphapca56 ;; 796 | EV6) UNAME_MACHINE=alphaev6 ;; 797 | EV67) UNAME_MACHINE=alphaev67 ;; 798 | EV68*) UNAME_MACHINE=alphaev68 ;; 799 | esac 800 | objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null 801 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 802 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 803 | exit 0 ;; 804 | parisc:Linux:*:* | hppa:Linux:*:*) 805 | # Look for CPU level 806 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 807 | PA7*) echo hppa1.1-unknown-linux-gnu ;; 808 | PA8*) echo hppa2.0-unknown-linux-gnu ;; 809 | *) echo hppa-unknown-linux-gnu ;; 810 | esac 811 | exit 0 ;; 812 | parisc64:Linux:*:* | hppa64:Linux:*:*) 813 | echo hppa64-unknown-linux-gnu 814 | exit 0 ;; 815 | s390:Linux:*:* | s390x:Linux:*:*) 816 | echo ${UNAME_MACHINE}-ibm-linux 817 | exit 0 ;; 818 | sh*:Linux:*:*) 819 | echo ${UNAME_MACHINE}-unknown-linux-gnu 820 | exit 0 ;; 821 | sparc:Linux:*:* | sparc64:Linux:*:*) 822 | echo ${UNAME_MACHINE}-unknown-linux-gnu 823 | exit 0 ;; 824 | x86_64:Linux:*:*) 825 | echo x86_64-unknown-linux-gnu 826 | exit 0 ;; 827 | i*86:Linux:*:*) 828 | # The BFD linker knows what the default object file format is, so 829 | # first see if it will tell us. cd to the root directory to prevent 830 | # problems with other programs or directories called `ld' in the path. 831 | ld_supported_targets=`cd /; ld --help 2>&1 \ 832 | | sed -ne '/supported targets:/!d 833 | s/[ ][ ]*/ /g 834 | s/.*supported targets: *// 835 | s/ .*// 836 | p'` 837 | case "$ld_supported_targets" in 838 | elf32-i386) 839 | TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" 840 | ;; 841 | a.out-i386-linux) 842 | echo "${UNAME_MACHINE}-pc-linux-gnuaout" 843 | exit 0 ;; 844 | coff-i386) 845 | echo "${UNAME_MACHINE}-pc-linux-gnucoff" 846 | exit 0 ;; 847 | "") 848 | # Either a pre-BFD a.out linker (linux-gnuoldld) or 849 | # one that does not give us useful --help. 850 | echo "${UNAME_MACHINE}-pc-linux-gnuoldld" 851 | exit 0 ;; 852 | esac 853 | # Determine whether the default compiler is a.out or elf 854 | cat >$dummy.c < 856 | #ifdef __cplusplus 857 | #include /* for printf() prototype */ 858 | int main (int argc, char *argv[]) { 859 | #else 860 | int main (argc, argv) int argc; char *argv[]; { 861 | #endif 862 | #ifdef __ELF__ 863 | # ifdef __GLIBC__ 864 | # if __GLIBC__ >= 2 865 | printf ("%s-pc-linux-gnu\n", argv[1]); 866 | # else 867 | printf ("%s-pc-linux-gnulibc1\n", argv[1]); 868 | # endif 869 | # else 870 | printf ("%s-pc-linux-gnulibc1\n", argv[1]); 871 | # endif 872 | #else 873 | printf ("%s-pc-linux-gnuaout\n", argv[1]); 874 | #endif 875 | return 0; 876 | } 877 | EOF 878 | eval $set_cc_for_build 879 | $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 880 | rm -f $dummy.c $dummy 881 | test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 882 | ;; 883 | i*86:DYNIX/ptx:4*:*) 884 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 885 | # earlier versions are messed up and put the nodename in both 886 | # sysname and nodename. 887 | echo i386-sequent-sysv4 888 | exit 0 ;; 889 | i*86:UNIX_SV:4.2MP:2.*) 890 | # Unixware is an offshoot of SVR4, but it has its own version 891 | # number series starting with 2... 892 | # I am not positive that other SVR4 systems won't match this, 893 | # I just have to hope. -- rms. 894 | # Use sysv4.2uw... so that sysv4* matches it. 895 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 896 | exit 0 ;; 897 | i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 898 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 899 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 900 | echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 901 | else 902 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 903 | fi 904 | exit 0 ;; 905 | i*86:*:5:[78]*) 906 | case `/bin/uname -X | grep "^Machine"` in 907 | *486*) UNAME_MACHINE=i486 ;; 908 | *Pentium) UNAME_MACHINE=i586 ;; 909 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 910 | esac 911 | echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 912 | exit 0 ;; 913 | i*86:*:3.2:*) 914 | if test -f /usr/options/cb.name; then 915 | UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then 918 | UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` 919 | (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 920 | (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ 921 | && UNAME_MACHINE=i586 922 | (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ 923 | && UNAME_MACHINE=i686 924 | (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ 925 | && UNAME_MACHINE=i686 926 | echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 927 | else 928 | echo ${UNAME_MACHINE}-pc-sysv32 929 | fi 930 | exit 0 ;; 931 | i*86:*DOS:*:*) 932 | echo ${UNAME_MACHINE}-pc-msdosdjgpp 933 | exit 0 ;; 934 | pc:*:*:*) 935 | # Left here for compatibility: 936 | # uname -m prints for DJGPP always 'pc', but it prints nothing about 937 | # the processor, so we play safe by assuming i386. 938 | echo i386-pc-msdosdjgpp 939 | exit 0 ;; 940 | Intel:Mach:3*:*) 941 | echo i386-pc-mach3 942 | exit 0 ;; 943 | paragon:*:*:*) 944 | echo i860-intel-osf1 945 | exit 0 ;; 946 | i860:*:4.*:*) # i860-SVR4 947 | if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 948 | echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 949 | else # Add other i860-SVR4 vendors below as they are discovered. 950 | echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 951 | fi 952 | exit 0 ;; 953 | mini*:CTIX:SYS*5:*) 954 | # "miniframe" 955 | echo m68010-convergent-sysv 956 | exit 0 ;; 957 | M68*:*:R3V[567]*:*) 958 | test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 959 | 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) 960 | OS_REL='' 961 | test -r /etc/.relid \ 962 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 963 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 964 | && echo i486-ncr-sysv4.3${OS_REL} && exit 0 965 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 966 | && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 967 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 968 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 969 | && echo i486-ncr-sysv4 && exit 0 ;; 970 | m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 971 | echo m68k-unknown-lynxos${UNAME_RELEASE} 972 | exit 0 ;; 973 | mc68030:UNIX_System_V:4.*:*) 974 | echo m68k-atari-sysv4 975 | exit 0 ;; 976 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) 977 | echo i386-unknown-lynxos${UNAME_RELEASE} 978 | exit 0 ;; 979 | TSUNAMI:LynxOS:2.*:*) 980 | echo sparc-unknown-lynxos${UNAME_RELEASE} 981 | exit 0 ;; 982 | rs6000:LynxOS:2.*:*) 983 | echo rs6000-unknown-lynxos${UNAME_RELEASE} 984 | exit 0 ;; 985 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) 986 | echo powerpc-unknown-lynxos${UNAME_RELEASE} 987 | exit 0 ;; 988 | SM[BE]S:UNIX_SV:*:*) 989 | echo mips-dde-sysv${UNAME_RELEASE} 990 | exit 0 ;; 991 | RM*:ReliantUNIX-*:*:*) 992 | echo mips-sni-sysv4 993 | exit 0 ;; 994 | RM*:SINIX-*:*:*) 995 | echo mips-sni-sysv4 996 | exit 0 ;; 997 | *:SINIX-*:*:*) 998 | if uname -p 2>/dev/null >/dev/null ; then 999 | UNAME_MACHINE=`(uname -p) 2>/dev/null` 1000 | echo ${UNAME_MACHINE}-sni-sysv4 1001 | else 1002 | echo ns32k-sni-sysv 1003 | fi 1004 | exit 0 ;; 1005 | PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1006 | # says 1007 | echo i586-unisys-sysv4 1008 | exit 0 ;; 1009 | *:UNIX_System_V:4*:FTX*) 1010 | # From Gerald Hewes . 1011 | # How about differentiating between stratus architectures? -djm 1012 | echo hppa1.1-stratus-sysv4 1013 | exit 0 ;; 1014 | *:*:*:FTX*) 1015 | # From seanf@swdc.stratus.com. 1016 | echo i860-stratus-sysv4 1017 | exit 0 ;; 1018 | *:VOS:*:*) 1019 | # From Paul.Green@stratus.com. 1020 | echo hppa1.1-stratus-vos 1021 | exit 0 ;; 1022 | mc68*:A/UX:*:*) 1023 | echo m68k-apple-aux${UNAME_RELEASE} 1024 | exit 0 ;; 1025 | news*:NEWS-OS:6*:*) 1026 | echo mips-sony-newsos6 1027 | exit 0 ;; 1028 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1029 | if [ -d /usr/nec ]; then 1030 | echo mips-nec-sysv${UNAME_RELEASE} 1031 | else 1032 | echo mips-unknown-sysv${UNAME_RELEASE} 1033 | fi 1034 | exit 0 ;; 1035 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1036 | echo powerpc-be-beos 1037 | exit 0 ;; 1038 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1039 | echo powerpc-apple-beos 1040 | exit 0 ;; 1041 | BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1042 | echo i586-pc-beos 1043 | exit 0 ;; 1044 | SX-4:SUPER-UX:*:*) 1045 | echo sx4-nec-superux${UNAME_RELEASE} 1046 | exit 0 ;; 1047 | SX-5:SUPER-UX:*:*) 1048 | echo sx5-nec-superux${UNAME_RELEASE} 1049 | exit 0 ;; 1050 | Power*:Rhapsody:*:*) 1051 | echo powerpc-apple-rhapsody${UNAME_RELEASE} 1052 | exit 0 ;; 1053 | *:Rhapsody:*:*) 1054 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1055 | exit 0 ;; 1056 | *:Darwin:*:*) 1057 | echo `uname -p`-apple-darwin${UNAME_RELEASE} 1058 | exit 0 ;; 1059 | *:procnto*:*:* | *:QNX:[0123456789]*:*) 1060 | if test "${UNAME_MACHINE}" = "x86pc"; then 1061 | UNAME_MACHINE=pc 1062 | fi 1063 | echo `uname -p`-${UNAME_MACHINE}-nto-qnx 1064 | exit 0 ;; 1065 | *:QNX:*:4*) 1066 | echo i386-pc-qnx 1067 | exit 0 ;; 1068 | NSR-[KW]:NONSTOP_KERNEL:*:*) 1069 | echo nsr-tandem-nsk${UNAME_RELEASE} 1070 | exit 0 ;; 1071 | *:NonStop-UX:*:*) 1072 | echo mips-compaq-nonstopux 1073 | exit 0 ;; 1074 | BS2000:POSIX*:*:*) 1075 | echo bs2000-siemens-sysv 1076 | exit 0 ;; 1077 | DS/*:UNIX_System_V:*:*) 1078 | echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1079 | exit 0 ;; 1080 | *:Plan9:*:*) 1081 | # "uname -m" is not consistent, so use $cputype instead. 386 1082 | # is converted to i386 for consistency with other x86 1083 | # operating systems. 1084 | if test "$cputype" = "386"; then 1085 | UNAME_MACHINE=i386 1086 | else 1087 | UNAME_MACHINE="$cputype" 1088 | fi 1089 | echo ${UNAME_MACHINE}-unknown-plan9 1090 | exit 0 ;; 1091 | i*86:OS/2:*:*) 1092 | # If we were able to find `uname', then EMX Unix compatibility 1093 | # is probably installed. 1094 | echo ${UNAME_MACHINE}-pc-os2-emx 1095 | exit 0 ;; 1096 | *:TOPS-10:*:*) 1097 | echo pdp10-unknown-tops10 1098 | exit 0 ;; 1099 | *:TENEX:*:*) 1100 | echo pdp10-unknown-tenex 1101 | exit 0 ;; 1102 | KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1103 | echo pdp10-dec-tops20 1104 | exit 0 ;; 1105 | XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1106 | echo pdp10-xkl-tops20 1107 | exit 0 ;; 1108 | *:TOPS-20:*:*) 1109 | echo pdp10-unknown-tops20 1110 | exit 0 ;; 1111 | *:ITS:*:*) 1112 | echo pdp10-unknown-its 1113 | exit 0 ;; 1114 | i*86:XTS-300:*:STOP) 1115 | echo ${UNAME_MACHINE}-unknown-stop 1116 | exit 0 ;; 1117 | esac 1118 | 1119 | #echo '(No uname command or uname output not recognized.)' 1>&2 1120 | #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1121 | 1122 | cat >$dummy.c < 1125 | # include 1126 | #endif 1127 | main () 1128 | { 1129 | #if defined (sony) 1130 | #if defined (MIPSEB) 1131 | /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1132 | I don't know.... */ 1133 | printf ("mips-sony-bsd\n"); exit (0); 1134 | #else 1135 | #include 1136 | printf ("m68k-sony-newsos%s\n", 1137 | #ifdef NEWSOS4 1138 | "4" 1139 | #else 1140 | "" 1141 | #endif 1142 | ); exit (0); 1143 | #endif 1144 | #endif 1145 | 1146 | #if defined (__arm) && defined (__acorn) && defined (__unix) 1147 | printf ("arm-acorn-riscix"); exit (0); 1148 | #endif 1149 | 1150 | #if defined (hp300) && !defined (hpux) 1151 | printf ("m68k-hp-bsd\n"); exit (0); 1152 | #endif 1153 | 1154 | #if defined (NeXT) 1155 | #if !defined (__ARCHITECTURE__) 1156 | #define __ARCHITECTURE__ "m68k" 1157 | #endif 1158 | int version; 1159 | version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1160 | if (version < 4) 1161 | printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1162 | else 1163 | printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1164 | exit (0); 1165 | #endif 1166 | 1167 | #if defined (MULTIMAX) || defined (n16) 1168 | #if defined (UMAXV) 1169 | printf ("ns32k-encore-sysv\n"); exit (0); 1170 | #else 1171 | #if defined (CMU) 1172 | printf ("ns32k-encore-mach\n"); exit (0); 1173 | #else 1174 | printf ("ns32k-encore-bsd\n"); exit (0); 1175 | #endif 1176 | #endif 1177 | #endif 1178 | 1179 | #if defined (__386BSD__) 1180 | printf ("i386-pc-bsd\n"); exit (0); 1181 | #endif 1182 | 1183 | #if defined (sequent) 1184 | #if defined (i386) 1185 | printf ("i386-sequent-dynix\n"); exit (0); 1186 | #endif 1187 | #if defined (ns32000) 1188 | printf ("ns32k-sequent-dynix\n"); exit (0); 1189 | #endif 1190 | #endif 1191 | 1192 | #if defined (_SEQUENT_) 1193 | struct utsname un; 1194 | 1195 | uname(&un); 1196 | 1197 | if (strncmp(un.version, "V2", 2) == 0) { 1198 | printf ("i386-sequent-ptx2\n"); exit (0); 1199 | } 1200 | if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1201 | printf ("i386-sequent-ptx1\n"); exit (0); 1202 | } 1203 | printf ("i386-sequent-ptx\n"); exit (0); 1204 | 1205 | #endif 1206 | 1207 | #if defined (vax) 1208 | # if !defined (ultrix) 1209 | # include 1210 | # if defined (BSD) 1211 | # if BSD == 43 1212 | printf ("vax-dec-bsd4.3\n"); exit (0); 1213 | # else 1214 | # if BSD == 199006 1215 | printf ("vax-dec-bsd4.3reno\n"); exit (0); 1216 | # else 1217 | printf ("vax-dec-bsd\n"); exit (0); 1218 | # endif 1219 | # endif 1220 | # else 1221 | printf ("vax-dec-bsd\n"); exit (0); 1222 | # endif 1223 | # else 1224 | printf ("vax-dec-ultrix\n"); exit (0); 1225 | # endif 1226 | #endif 1227 | 1228 | #if defined (alliant) && defined (i860) 1229 | printf ("i860-alliant-bsd\n"); exit (0); 1230 | #endif 1231 | 1232 | exit (1); 1233 | } 1234 | EOF 1235 | 1236 | eval $set_cc_for_build 1237 | $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 1238 | rm -f $dummy.c $dummy 1239 | 1240 | # Apollos put the system type in the environment. 1241 | 1242 | test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } 1243 | 1244 | # Convex versions that predate uname can use getsysinfo(1) 1245 | 1246 | if [ -x /usr/convex/getsysinfo ] 1247 | then 1248 | case `getsysinfo -f cpu_type` in 1249 | c1*) 1250 | echo c1-convex-bsd 1251 | exit 0 ;; 1252 | c2*) 1253 | if getsysinfo -f scalar_acc 1254 | then echo c32-convex-bsd 1255 | else echo c2-convex-bsd 1256 | fi 1257 | exit 0 ;; 1258 | c34*) 1259 | echo c34-convex-bsd 1260 | exit 0 ;; 1261 | c38*) 1262 | echo c38-convex-bsd 1263 | exit 0 ;; 1264 | c4*) 1265 | echo c4-convex-bsd 1266 | exit 0 ;; 1267 | esac 1268 | fi 1269 | 1270 | cat >&2 < in order to provide the needed 1282 | information to handle your system. 1283 | 1284 | config.guess timestamp = $timestamp 1285 | 1286 | uname -m = `(uname -m) 2>/dev/null || echo unknown` 1287 | uname -r = `(uname -r) 2>/dev/null || echo unknown` 1288 | uname -s = `(uname -s) 2>/dev/null || echo unknown` 1289 | uname -v = `(uname -v) 2>/dev/null || echo unknown` 1290 | 1291 | /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1292 | /bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1293 | 1294 | hostinfo = `(hostinfo) 2>/dev/null` 1295 | /bin/universe = `(/bin/universe) 2>/dev/null` 1296 | /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1297 | /bin/arch = `(/bin/arch) 2>/dev/null` 1298 | /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1299 | /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1300 | 1301 | UNAME_MACHINE = ${UNAME_MACHINE} 1302 | UNAME_RELEASE = ${UNAME_RELEASE} 1303 | UNAME_SYSTEM = ${UNAME_SYSTEM} 1304 | UNAME_VERSION = ${UNAME_VERSION} 1305 | EOF 1306 | 1307 | exit 1 1308 | 1309 | # Local variables: 1310 | # eval: (add-hook 'write-file-hooks 'time-stamp) 1311 | # time-stamp-start: "timestamp='" 1312 | # time-stamp-format: "%:y-%02m-%02d" 1313 | # time-stamp-end: "'" 1314 | # End: 1315 | -------------------------------------------------------------------------------- /config.sub: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Configuration validation subroutine script. 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 4 | # Free Software Foundation, Inc. 5 | 6 | timestamp='2001-08-13' 7 | 8 | # This file is (in principle) common to ALL GNU software. 9 | # The presence of a machine in this file suggests that SOME GNU software 10 | # can handle that machine. It does not imply ALL GNU software can. 11 | # 12 | # This file is free software; you can redistribute it and/or modify 13 | # it under the terms of the GNU General Public License as published by 14 | # the Free Software Foundation; either version 2 of the License, or 15 | # (at your option) any later version. 16 | # 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # GNU General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License 23 | # along with this program; if not, write to the Free Software 24 | # Foundation, Inc., 59 Temple Place - Suite 330, 25 | # Boston, MA 02111-1307, USA. 26 | 27 | # As a special exception to the GNU General Public License, if you 28 | # distribute this file as part of a program that contains a 29 | # configuration script generated by Autoconf, you may include it under 30 | # the same distribution terms that you use for the rest of that program. 31 | 32 | # Please send patches to . 33 | # 34 | # Configuration subroutine to validate and canonicalize a configuration type. 35 | # Supply the specified configuration type as an argument. 36 | # If it is invalid, we print an error message on stderr and exit with code 1. 37 | # Otherwise, we print the canonical config type on stdout and succeed. 38 | 39 | # This file is supposed to be the same for all GNU packages 40 | # and recognize all the CPU types, system types and aliases 41 | # that are meaningful with *any* GNU software. 42 | # Each package is responsible for reporting which valid configurations 43 | # it does not support. The user should be able to distinguish 44 | # a failure to support a valid configuration from a meaningless 45 | # configuration. 46 | 47 | # The goal of this file is to map all the various variations of a given 48 | # machine specification into a single specification in the form: 49 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM 50 | # or in some cases, the newer four-part form: 51 | # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 52 | # It is wrong to echo any other type of specification. 53 | 54 | me=`echo "$0" | sed -e 's,.*/,,'` 55 | 56 | usage="\ 57 | Usage: $0 [OPTION] CPU-MFR-OPSYS 58 | $0 [OPTION] ALIAS 59 | 60 | Canonicalize a configuration name. 61 | 62 | Operation modes: 63 | -h, --help print this help, then exit 64 | -t, --time-stamp print date of last modification, then exit 65 | -v, --version print version number, then exit 66 | 67 | Report bugs and patches to ." 68 | 69 | version="\ 70 | GNU config.sub ($timestamp) 71 | 72 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 73 | Free Software Foundation, Inc. 74 | 75 | This is free software; see the source for copying conditions. There is NO 76 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 77 | 78 | help=" 79 | Try \`$me --help' for more information." 80 | 81 | # Parse command line 82 | while test $# -gt 0 ; do 83 | case $1 in 84 | --time-stamp | --time* | -t ) 85 | echo "$timestamp" ; exit 0 ;; 86 | --version | -v ) 87 | echo "$version" ; exit 0 ;; 88 | --help | --h* | -h ) 89 | echo "$usage"; exit 0 ;; 90 | -- ) # Stop option processing 91 | shift; break ;; 92 | - ) # Use stdin as input. 93 | break ;; 94 | -* ) 95 | echo "$me: invalid option $1$help" 96 | exit 1 ;; 97 | 98 | *local*) 99 | # First pass through any local machine types. 100 | echo $1 101 | exit 0;; 102 | 103 | * ) 104 | break ;; 105 | esac 106 | done 107 | 108 | case $# in 109 | 0) echo "$me: missing argument$help" >&2 110 | exit 1;; 111 | 1) ;; 112 | *) echo "$me: too many arguments$help" >&2 113 | exit 1;; 114 | esac 115 | 116 | # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). 117 | # Here we must recognize all the valid KERNEL-OS combinations. 118 | maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` 119 | case $maybe_os in 120 | nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) 121 | os=-$maybe_os 122 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` 123 | ;; 124 | *) 125 | basic_machine=`echo $1 | sed 's/-[^-]*$//'` 126 | if [ $basic_machine != $1 ] 127 | then os=`echo $1 | sed 's/.*-/-/'` 128 | else os=; fi 129 | ;; 130 | esac 131 | 132 | ### Let's recognize common machines as not being operating systems so 133 | ### that things like config.sub decstation-3100 work. We also 134 | ### recognize some manufacturers as not being operating systems, so we 135 | ### can provide default operating systems below. 136 | case $os in 137 | -sun*os*) 138 | # Prevent following clause from handling this invalid input. 139 | ;; 140 | -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ 141 | -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ 142 | -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ 143 | -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ 144 | -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ 145 | -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ 146 | -apple | -axis) 147 | os= 148 | basic_machine=$1 149 | ;; 150 | -sim | -cisco | -oki | -wec | -winbond) 151 | os= 152 | basic_machine=$1 153 | ;; 154 | -scout) 155 | ;; 156 | -wrs) 157 | os=-vxworks 158 | basic_machine=$1 159 | ;; 160 | -chorusos*) 161 | os=-chorusos 162 | basic_machine=$1 163 | ;; 164 | -chorusrdb) 165 | os=-chorusrdb 166 | basic_machine=$1 167 | ;; 168 | -hiux*) 169 | os=-hiuxwe2 170 | ;; 171 | -sco5) 172 | os=-sco3.2v5 173 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 174 | ;; 175 | -sco4) 176 | os=-sco3.2v4 177 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 178 | ;; 179 | -sco3.2.[4-9]*) 180 | os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` 181 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 182 | ;; 183 | -sco3.2v[4-9]*) 184 | # Don't forget version if it is 3.2v4 or newer. 185 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 186 | ;; 187 | -sco*) 188 | os=-sco3.2v2 189 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 190 | ;; 191 | -udk*) 192 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 193 | ;; 194 | -isc) 195 | os=-isc2.2 196 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 197 | ;; 198 | -clix*) 199 | basic_machine=clipper-intergraph 200 | ;; 201 | -isc*) 202 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` 203 | ;; 204 | -lynx*) 205 | os=-lynxos 206 | ;; 207 | -ptx*) 208 | basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` 209 | ;; 210 | -windowsnt*) 211 | os=`echo $os | sed -e 's/windowsnt/winnt/'` 212 | ;; 213 | -psos*) 214 | os=-psos 215 | ;; 216 | -mint | -mint[0-9]*) 217 | basic_machine=m68k-atari 218 | os=-mint 219 | ;; 220 | esac 221 | 222 | # Decode aliases for certain CPU-COMPANY combinations. 223 | case $basic_machine in 224 | # Recognize the basic CPU types without company name. 225 | # Some are omitted here because they have special meanings below. 226 | 1750a | 580 \ 227 | | a29k \ 228 | | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ 229 | | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ 230 | | c4x | clipper \ 231 | | d10v | d30v | dsp16xx \ 232 | | fr30 \ 233 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ 234 | | i370 | i860 | i960 | ia64 \ 235 | | m32r | m68000 | m68k | m88k | mcore \ 236 | | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ 237 | | mips64vr4100 | mips64vr4100el | mips64vr4300 \ 238 | | mips64vr4300el | mips64vr5000 | mips64vr5000el \ 239 | | mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \ 240 | | mn10200 | mn10300 \ 241 | | ns16k | ns32k \ 242 | | openrisc \ 243 | | pdp10 | pdp11 | pj | pjl \ 244 | | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ 245 | | pyramid \ 246 | | s390 | s390x \ 247 | | sh | sh[34] | sh[34]eb | shbe | shle \ 248 | | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ 249 | | strongarm \ 250 | | tahoe | thumb | tic80 | tron \ 251 | | v850 \ 252 | | we32k \ 253 | | x86 | xscale \ 254 | | z8k) 255 | basic_machine=$basic_machine-unknown 256 | ;; 257 | m6811 | m68hc11 | m6812 | m68hc12) 258 | # Motorola 68HC11/12. 259 | basic_machine=$basic_machine-unknown 260 | os=-none 261 | ;; 262 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) 263 | ;; 264 | 265 | # We use `pc' rather than `unknown' 266 | # because (1) that's what they normally are, and 267 | # (2) the word "unknown" tends to confuse beginning users. 268 | i*86 | x86_64) 269 | basic_machine=$basic_machine-pc 270 | ;; 271 | # Object if more than one company name word. 272 | *-*-*) 273 | echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 274 | exit 1 275 | ;; 276 | # Recognize the basic CPU types with company name. 277 | 580-* \ 278 | | a29k-* \ 279 | | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ 280 | | alphapca5[67]-* | arc-* \ 281 | | arm-* | armbe-* | armle-* | armv*-* \ 282 | | bs2000-* \ 283 | | c[123]* | c30-* | [cjt]90-* | c54x-* \ 284 | | clipper-* | cray2-* | cydra-* \ 285 | | d10v-* | d30v-* \ 286 | | elxsi-* \ 287 | | f30[01]-* | f700-* | fr30-* | fx80-* \ 288 | | h8300-* | h8500-* \ 289 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ 290 | | i*86-* | i860-* | i960-* | ia64-* \ 291 | | m32r-* \ 292 | | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ 293 | | m88110-* | m88k-* | mcore-* \ 294 | | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ 295 | | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ 296 | | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \ 297 | | mipsle-* | mipstx39-* | mipstx39el-* \ 298 | | none-* | np1-* | ns16k-* | ns32k-* \ 299 | | orion-* \ 300 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ 301 | | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ 302 | | pyramid-* \ 303 | | romp-* | rs6000-* \ 304 | | s390-* | s390x-* \ 305 | | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ 306 | | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ 307 | | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ 308 | | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ 309 | | v850-* | vax-* \ 310 | | we32k-* \ 311 | | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ 312 | | ymp-* \ 313 | | z8k-*) 314 | ;; 315 | # Recognize the various machine names and aliases which stand 316 | # for a CPU type and a company and sometimes even an OS. 317 | 386bsd) 318 | basic_machine=i386-unknown 319 | os=-bsd 320 | ;; 321 | 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 322 | basic_machine=m68000-att 323 | ;; 324 | 3b*) 325 | basic_machine=we32k-att 326 | ;; 327 | a29khif) 328 | basic_machine=a29k-amd 329 | os=-udi 330 | ;; 331 | adobe68k) 332 | basic_machine=m68010-adobe 333 | os=-scout 334 | ;; 335 | alliant | fx80) 336 | basic_machine=fx80-alliant 337 | ;; 338 | altos | altos3068) 339 | basic_machine=m68k-altos 340 | ;; 341 | am29k) 342 | basic_machine=a29k-none 343 | os=-bsd 344 | ;; 345 | amdahl) 346 | basic_machine=580-amdahl 347 | os=-sysv 348 | ;; 349 | amiga | amiga-*) 350 | basic_machine=m68k-unknown 351 | ;; 352 | amigaos | amigados) 353 | basic_machine=m68k-unknown 354 | os=-amigaos 355 | ;; 356 | amigaunix | amix) 357 | basic_machine=m68k-unknown 358 | os=-sysv4 359 | ;; 360 | apollo68) 361 | basic_machine=m68k-apollo 362 | os=-sysv 363 | ;; 364 | apollo68bsd) 365 | basic_machine=m68k-apollo 366 | os=-bsd 367 | ;; 368 | aux) 369 | basic_machine=m68k-apple 370 | os=-aux 371 | ;; 372 | balance) 373 | basic_machine=ns32k-sequent 374 | os=-dynix 375 | ;; 376 | convex-c1) 377 | basic_machine=c1-convex 378 | os=-bsd 379 | ;; 380 | convex-c2) 381 | basic_machine=c2-convex 382 | os=-bsd 383 | ;; 384 | convex-c32) 385 | basic_machine=c32-convex 386 | os=-bsd 387 | ;; 388 | convex-c34) 389 | basic_machine=c34-convex 390 | os=-bsd 391 | ;; 392 | convex-c38) 393 | basic_machine=c38-convex 394 | os=-bsd 395 | ;; 396 | cray | ymp) 397 | basic_machine=ymp-cray 398 | os=-unicos 399 | ;; 400 | cray2) 401 | basic_machine=cray2-cray 402 | os=-unicos 403 | ;; 404 | [cjt]90) 405 | basic_machine=${basic_machine}-cray 406 | os=-unicos 407 | ;; 408 | crds | unos) 409 | basic_machine=m68k-crds 410 | ;; 411 | cris | cris-* | etrax*) 412 | basic_machine=cris-axis 413 | ;; 414 | da30 | da30-*) 415 | basic_machine=m68k-da30 416 | ;; 417 | decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) 418 | basic_machine=mips-dec 419 | ;; 420 | delta | 3300 | motorola-3300 | motorola-delta \ 421 | | 3300-motorola | delta-motorola) 422 | basic_machine=m68k-motorola 423 | ;; 424 | delta88) 425 | basic_machine=m88k-motorola 426 | os=-sysv3 427 | ;; 428 | dpx20 | dpx20-*) 429 | basic_machine=rs6000-bull 430 | os=-bosx 431 | ;; 432 | dpx2* | dpx2*-bull) 433 | basic_machine=m68k-bull 434 | os=-sysv3 435 | ;; 436 | ebmon29k) 437 | basic_machine=a29k-amd 438 | os=-ebmon 439 | ;; 440 | elxsi) 441 | basic_machine=elxsi-elxsi 442 | os=-bsd 443 | ;; 444 | encore | umax | mmax) 445 | basic_machine=ns32k-encore 446 | ;; 447 | es1800 | OSE68k | ose68k | ose | OSE) 448 | basic_machine=m68k-ericsson 449 | os=-ose 450 | ;; 451 | fx2800) 452 | basic_machine=i860-alliant 453 | ;; 454 | genix) 455 | basic_machine=ns32k-ns 456 | ;; 457 | gmicro) 458 | basic_machine=tron-gmicro 459 | os=-sysv 460 | ;; 461 | go32) 462 | basic_machine=i386-pc 463 | os=-go32 464 | ;; 465 | h3050r* | hiux*) 466 | basic_machine=hppa1.1-hitachi 467 | os=-hiuxwe2 468 | ;; 469 | h8300hms) 470 | basic_machine=h8300-hitachi 471 | os=-hms 472 | ;; 473 | h8300xray) 474 | basic_machine=h8300-hitachi 475 | os=-xray 476 | ;; 477 | h8500hms) 478 | basic_machine=h8500-hitachi 479 | os=-hms 480 | ;; 481 | harris) 482 | basic_machine=m88k-harris 483 | os=-sysv3 484 | ;; 485 | hp300-*) 486 | basic_machine=m68k-hp 487 | ;; 488 | hp300bsd) 489 | basic_machine=m68k-hp 490 | os=-bsd 491 | ;; 492 | hp300hpux) 493 | basic_machine=m68k-hp 494 | os=-hpux 495 | ;; 496 | hp3k9[0-9][0-9] | hp9[0-9][0-9]) 497 | basic_machine=hppa1.0-hp 498 | ;; 499 | hp9k2[0-9][0-9] | hp9k31[0-9]) 500 | basic_machine=m68000-hp 501 | ;; 502 | hp9k3[2-9][0-9]) 503 | basic_machine=m68k-hp 504 | ;; 505 | hp9k6[0-9][0-9] | hp6[0-9][0-9]) 506 | basic_machine=hppa1.0-hp 507 | ;; 508 | hp9k7[0-79][0-9] | hp7[0-79][0-9]) 509 | basic_machine=hppa1.1-hp 510 | ;; 511 | hp9k78[0-9] | hp78[0-9]) 512 | # FIXME: really hppa2.0-hp 513 | basic_machine=hppa1.1-hp 514 | ;; 515 | hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) 516 | # FIXME: really hppa2.0-hp 517 | basic_machine=hppa1.1-hp 518 | ;; 519 | hp9k8[0-9][13679] | hp8[0-9][13679]) 520 | basic_machine=hppa1.1-hp 521 | ;; 522 | hp9k8[0-9][0-9] | hp8[0-9][0-9]) 523 | basic_machine=hppa1.0-hp 524 | ;; 525 | hppa-next) 526 | os=-nextstep3 527 | ;; 528 | hppaosf) 529 | basic_machine=hppa1.1-hp 530 | os=-osf 531 | ;; 532 | hppro) 533 | basic_machine=hppa1.1-hp 534 | os=-proelf 535 | ;; 536 | i370-ibm* | ibm*) 537 | basic_machine=i370-ibm 538 | ;; 539 | # I'm not sure what "Sysv32" means. Should this be sysv3.2? 540 | i*86v32) 541 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 542 | os=-sysv32 543 | ;; 544 | i*86v4*) 545 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 546 | os=-sysv4 547 | ;; 548 | i*86v) 549 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 550 | os=-sysv 551 | ;; 552 | i*86sol2) 553 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` 554 | os=-solaris2 555 | ;; 556 | i386mach) 557 | basic_machine=i386-mach 558 | os=-mach 559 | ;; 560 | i386-vsta | vsta) 561 | basic_machine=i386-unknown 562 | os=-vsta 563 | ;; 564 | iris | iris4d) 565 | basic_machine=mips-sgi 566 | case $os in 567 | -irix*) 568 | ;; 569 | *) 570 | os=-irix4 571 | ;; 572 | esac 573 | ;; 574 | isi68 | isi) 575 | basic_machine=m68k-isi 576 | os=-sysv 577 | ;; 578 | m88k-omron*) 579 | basic_machine=m88k-omron 580 | ;; 581 | magnum | m3230) 582 | basic_machine=mips-mips 583 | os=-sysv 584 | ;; 585 | merlin) 586 | basic_machine=ns32k-utek 587 | os=-sysv 588 | ;; 589 | mingw32) 590 | basic_machine=i386-pc 591 | os=-mingw32 592 | ;; 593 | miniframe) 594 | basic_machine=m68000-convergent 595 | ;; 596 | *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) 597 | basic_machine=m68k-atari 598 | os=-mint 599 | ;; 600 | mipsel*-linux*) 601 | basic_machine=mipsel-unknown 602 | os=-linux-gnu 603 | ;; 604 | mips*-linux*) 605 | basic_machine=mips-unknown 606 | os=-linux-gnu 607 | ;; 608 | mips3*-*) 609 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` 610 | ;; 611 | mips3*) 612 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown 613 | ;; 614 | mmix*) 615 | basic_machine=mmix-knuth 616 | os=-mmixware 617 | ;; 618 | monitor) 619 | basic_machine=m68k-rom68k 620 | os=-coff 621 | ;; 622 | msdos) 623 | basic_machine=i386-pc 624 | os=-msdos 625 | ;; 626 | mvs) 627 | basic_machine=i370-ibm 628 | os=-mvs 629 | ;; 630 | ncr3000) 631 | basic_machine=i486-ncr 632 | os=-sysv4 633 | ;; 634 | netbsd386) 635 | basic_machine=i386-unknown 636 | os=-netbsd 637 | ;; 638 | netwinder) 639 | basic_machine=armv4l-rebel 640 | os=-linux 641 | ;; 642 | news | news700 | news800 | news900) 643 | basic_machine=m68k-sony 644 | os=-newsos 645 | ;; 646 | news1000) 647 | basic_machine=m68030-sony 648 | os=-newsos 649 | ;; 650 | news-3600 | risc-news) 651 | basic_machine=mips-sony 652 | os=-newsos 653 | ;; 654 | necv70) 655 | basic_machine=v70-nec 656 | os=-sysv 657 | ;; 658 | next | m*-next ) 659 | basic_machine=m68k-next 660 | case $os in 661 | -nextstep* ) 662 | ;; 663 | -ns2*) 664 | os=-nextstep2 665 | ;; 666 | *) 667 | os=-nextstep3 668 | ;; 669 | esac 670 | ;; 671 | nh3000) 672 | basic_machine=m68k-harris 673 | os=-cxux 674 | ;; 675 | nh[45]000) 676 | basic_machine=m88k-harris 677 | os=-cxux 678 | ;; 679 | nindy960) 680 | basic_machine=i960-intel 681 | os=-nindy 682 | ;; 683 | mon960) 684 | basic_machine=i960-intel 685 | os=-mon960 686 | ;; 687 | nonstopux) 688 | basic_machine=mips-compaq 689 | os=-nonstopux 690 | ;; 691 | np1) 692 | basic_machine=np1-gould 693 | ;; 694 | nsr-tandem) 695 | basic_machine=nsr-tandem 696 | ;; 697 | op50n-* | op60c-*) 698 | basic_machine=hppa1.1-oki 699 | os=-proelf 700 | ;; 701 | OSE68000 | ose68000) 702 | basic_machine=m68000-ericsson 703 | os=-ose 704 | ;; 705 | os68k) 706 | basic_machine=m68k-none 707 | os=-os68k 708 | ;; 709 | pa-hitachi) 710 | basic_machine=hppa1.1-hitachi 711 | os=-hiuxwe2 712 | ;; 713 | paragon) 714 | basic_machine=i860-intel 715 | os=-osf 716 | ;; 717 | pbd) 718 | basic_machine=sparc-tti 719 | ;; 720 | pbb) 721 | basic_machine=m68k-tti 722 | ;; 723 | pc532 | pc532-*) 724 | basic_machine=ns32k-pc532 725 | ;; 726 | pentium | p5 | k5 | k6 | nexgen) 727 | basic_machine=i586-pc 728 | ;; 729 | pentiumpro | p6 | 6x86 | athlon) 730 | basic_machine=i686-pc 731 | ;; 732 | pentiumii | pentium2) 733 | basic_machine=i686-pc 734 | ;; 735 | pentium-* | p5-* | k5-* | k6-* | nexgen-*) 736 | basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` 737 | ;; 738 | pentiumpro-* | p6-* | 6x86-* | athlon-*) 739 | basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` 740 | ;; 741 | pentiumii-* | pentium2-*) 742 | basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` 743 | ;; 744 | pn) 745 | basic_machine=pn-gould 746 | ;; 747 | power) basic_machine=power-ibm 748 | ;; 749 | ppc) basic_machine=powerpc-unknown 750 | ;; 751 | ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` 752 | ;; 753 | ppcle | powerpclittle | ppc-le | powerpc-little) 754 | basic_machine=powerpcle-unknown 755 | ;; 756 | ppcle-* | powerpclittle-*) 757 | basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` 758 | ;; 759 | ppc64) basic_machine=powerpc64-unknown 760 | ;; 761 | ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` 762 | ;; 763 | ppc64le | powerpc64little | ppc64-le | powerpc64-little) 764 | basic_machine=powerpc64le-unknown 765 | ;; 766 | ppc64le-* | powerpc64little-*) 767 | basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` 768 | ;; 769 | ps2) 770 | basic_machine=i386-ibm 771 | ;; 772 | pw32) 773 | basic_machine=i586-unknown 774 | os=-pw32 775 | ;; 776 | rom68k) 777 | basic_machine=m68k-rom68k 778 | os=-coff 779 | ;; 780 | rm[46]00) 781 | basic_machine=mips-siemens 782 | ;; 783 | rtpc | rtpc-*) 784 | basic_machine=romp-ibm 785 | ;; 786 | sa29200) 787 | basic_machine=a29k-amd 788 | os=-udi 789 | ;; 790 | sequent) 791 | basic_machine=i386-sequent 792 | ;; 793 | sh) 794 | basic_machine=sh-hitachi 795 | os=-hms 796 | ;; 797 | sparclite-wrs) 798 | basic_machine=sparclite-wrs 799 | os=-vxworks 800 | ;; 801 | sps7) 802 | basic_machine=m68k-bull 803 | os=-sysv2 804 | ;; 805 | spur) 806 | basic_machine=spur-unknown 807 | ;; 808 | st2000) 809 | basic_machine=m68k-tandem 810 | ;; 811 | stratus) 812 | basic_machine=i860-stratus 813 | os=-sysv4 814 | ;; 815 | sun2) 816 | basic_machine=m68000-sun 817 | ;; 818 | sun2os3) 819 | basic_machine=m68000-sun 820 | os=-sunos3 821 | ;; 822 | sun2os4) 823 | basic_machine=m68000-sun 824 | os=-sunos4 825 | ;; 826 | sun3os3) 827 | basic_machine=m68k-sun 828 | os=-sunos3 829 | ;; 830 | sun3os4) 831 | basic_machine=m68k-sun 832 | os=-sunos4 833 | ;; 834 | sun4os3) 835 | basic_machine=sparc-sun 836 | os=-sunos3 837 | ;; 838 | sun4os4) 839 | basic_machine=sparc-sun 840 | os=-sunos4 841 | ;; 842 | sun4sol2) 843 | basic_machine=sparc-sun 844 | os=-solaris2 845 | ;; 846 | sun3 | sun3-*) 847 | basic_machine=m68k-sun 848 | ;; 849 | sun4) 850 | basic_machine=sparc-sun 851 | ;; 852 | sun386 | sun386i | roadrunner) 853 | basic_machine=i386-sun 854 | ;; 855 | sv1) 856 | basic_machine=sv1-cray 857 | os=-unicos 858 | ;; 859 | symmetry) 860 | basic_machine=i386-sequent 861 | os=-dynix 862 | ;; 863 | t3e) 864 | basic_machine=t3e-cray 865 | os=-unicos 866 | ;; 867 | tic54x | c54x*) 868 | basic_machine=tic54x-unknown 869 | os=-coff 870 | ;; 871 | tx39) 872 | basic_machine=mipstx39-unknown 873 | ;; 874 | tx39el) 875 | basic_machine=mipstx39el-unknown 876 | ;; 877 | tower | tower-32) 878 | basic_machine=m68k-ncr 879 | ;; 880 | udi29k) 881 | basic_machine=a29k-amd 882 | os=-udi 883 | ;; 884 | ultra3) 885 | basic_machine=a29k-nyu 886 | os=-sym1 887 | ;; 888 | v810 | necv810) 889 | basic_machine=v810-nec 890 | os=-none 891 | ;; 892 | vaxv) 893 | basic_machine=vax-dec 894 | os=-sysv 895 | ;; 896 | vms) 897 | basic_machine=vax-dec 898 | os=-vms 899 | ;; 900 | vpp*|vx|vx-*) 901 | basic_machine=f301-fujitsu 902 | ;; 903 | vxworks960) 904 | basic_machine=i960-wrs 905 | os=-vxworks 906 | ;; 907 | vxworks68) 908 | basic_machine=m68k-wrs 909 | os=-vxworks 910 | ;; 911 | vxworks29k) 912 | basic_machine=a29k-wrs 913 | os=-vxworks 914 | ;; 915 | w65*) 916 | basic_machine=w65-wdc 917 | os=-none 918 | ;; 919 | w89k-*) 920 | basic_machine=hppa1.1-winbond 921 | os=-proelf 922 | ;; 923 | windows32) 924 | basic_machine=i386-pc 925 | os=-windows32-msvcrt 926 | ;; 927 | xmp) 928 | basic_machine=xmp-cray 929 | os=-unicos 930 | ;; 931 | xps | xps100) 932 | basic_machine=xps100-honeywell 933 | ;; 934 | z8k-*-coff) 935 | basic_machine=z8k-unknown 936 | os=-sim 937 | ;; 938 | none) 939 | basic_machine=none-none 940 | os=-none 941 | ;; 942 | 943 | # Here we handle the default manufacturer of certain CPU types. It is in 944 | # some cases the only manufacturer, in others, it is the most popular. 945 | w89k) 946 | basic_machine=hppa1.1-winbond 947 | ;; 948 | op50n) 949 | basic_machine=hppa1.1-oki 950 | ;; 951 | op60c) 952 | basic_machine=hppa1.1-oki 953 | ;; 954 | mips) 955 | if [ x$os = x-linux-gnu ]; then 956 | basic_machine=mips-unknown 957 | else 958 | basic_machine=mips-mips 959 | fi 960 | ;; 961 | romp) 962 | basic_machine=romp-ibm 963 | ;; 964 | rs6000) 965 | basic_machine=rs6000-ibm 966 | ;; 967 | vax) 968 | basic_machine=vax-dec 969 | ;; 970 | pdp10) 971 | # there are many clones, so DEC is not a safe bet 972 | basic_machine=pdp10-unknown 973 | ;; 974 | pdp11) 975 | basic_machine=pdp11-dec 976 | ;; 977 | we32k) 978 | basic_machine=we32k-att 979 | ;; 980 | sh3 | sh4 | sh3eb | sh4eb) 981 | basic_machine=sh-unknown 982 | ;; 983 | sparc | sparcv9 | sparcv9b) 984 | basic_machine=sparc-sun 985 | ;; 986 | cydra) 987 | basic_machine=cydra-cydrome 988 | ;; 989 | orion) 990 | basic_machine=orion-highlevel 991 | ;; 992 | orion105) 993 | basic_machine=clipper-highlevel 994 | ;; 995 | mac | mpw | mac-mpw) 996 | basic_machine=m68k-apple 997 | ;; 998 | pmac | pmac-mpw) 999 | basic_machine=powerpc-apple 1000 | ;; 1001 | c4x*) 1002 | basic_machine=c4x-none 1003 | os=-coff 1004 | ;; 1005 | *-unknown) 1006 | # Make sure to match an already-canonicalized machine name. 1007 | ;; 1008 | *) 1009 | echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 1010 | exit 1 1011 | ;; 1012 | esac 1013 | 1014 | # Here we canonicalize certain aliases for manufacturers. 1015 | case $basic_machine in 1016 | *-digital*) 1017 | basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` 1018 | ;; 1019 | *-commodore*) 1020 | basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` 1021 | ;; 1022 | *) 1023 | ;; 1024 | esac 1025 | 1026 | # Decode manufacturer-specific aliases for certain operating systems. 1027 | 1028 | if [ x"$os" != x"" ] 1029 | then 1030 | case $os in 1031 | # First match some system type aliases 1032 | # that might get confused with valid system types. 1033 | # -solaris* is a basic system type, with this one exception. 1034 | -solaris1 | -solaris1.*) 1035 | os=`echo $os | sed -e 's|solaris1|sunos4|'` 1036 | ;; 1037 | -solaris) 1038 | os=-solaris2 1039 | ;; 1040 | -svr4*) 1041 | os=-sysv4 1042 | ;; 1043 | -unixware*) 1044 | os=-sysv4.2uw 1045 | ;; 1046 | -gnu/linux*) 1047 | os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` 1048 | ;; 1049 | # First accept the basic system types. 1050 | # The portable systems comes first. 1051 | # Each alternative MUST END IN A *, to match a version number. 1052 | # -sysv* is not here because it comes later, after sysvr4. 1053 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ 1054 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ 1055 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ 1056 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ 1057 | | -aos* \ 1058 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ 1059 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ 1060 | | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ 1061 | | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ 1062 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ 1063 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ 1064 | | -chorusos* | -chorusrdb* \ 1065 | | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ 1066 | | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ 1067 | | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ 1068 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ 1069 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ 1070 | | -os2* | -vos*) 1071 | # Remember, each alternative MUST END IN *, to match a version number. 1072 | ;; 1073 | -qnx*) 1074 | case $basic_machine in 1075 | x86-* | i*86-*) 1076 | ;; 1077 | *) 1078 | os=-nto$os 1079 | ;; 1080 | esac 1081 | ;; 1082 | -nto*) 1083 | os=-nto-qnx 1084 | ;; 1085 | -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ 1086 | | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ 1087 | | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) 1088 | ;; 1089 | -mac*) 1090 | os=`echo $os | sed -e 's|mac|macos|'` 1091 | ;; 1092 | -linux*) 1093 | os=`echo $os | sed -e 's|linux|linux-gnu|'` 1094 | ;; 1095 | -sunos5*) 1096 | os=`echo $os | sed -e 's|sunos5|solaris2|'` 1097 | ;; 1098 | -sunos6*) 1099 | os=`echo $os | sed -e 's|sunos6|solaris3|'` 1100 | ;; 1101 | -opened*) 1102 | os=-openedition 1103 | ;; 1104 | -wince*) 1105 | os=-wince 1106 | ;; 1107 | -osfrose*) 1108 | os=-osfrose 1109 | ;; 1110 | -osf*) 1111 | os=-osf 1112 | ;; 1113 | -utek*) 1114 | os=-bsd 1115 | ;; 1116 | -dynix*) 1117 | os=-bsd 1118 | ;; 1119 | -acis*) 1120 | os=-aos 1121 | ;; 1122 | -386bsd) 1123 | os=-bsd 1124 | ;; 1125 | -ctix* | -uts*) 1126 | os=-sysv 1127 | ;; 1128 | -ns2 ) 1129 | os=-nextstep2 1130 | ;; 1131 | -nsk*) 1132 | os=-nsk 1133 | ;; 1134 | # Preserve the version number of sinix5. 1135 | -sinix5.*) 1136 | os=`echo $os | sed -e 's|sinix|sysv|'` 1137 | ;; 1138 | -sinix*) 1139 | os=-sysv4 1140 | ;; 1141 | -triton*) 1142 | os=-sysv3 1143 | ;; 1144 | -oss*) 1145 | os=-sysv3 1146 | ;; 1147 | -svr4) 1148 | os=-sysv4 1149 | ;; 1150 | -svr3) 1151 | os=-sysv3 1152 | ;; 1153 | -sysvr4) 1154 | os=-sysv4 1155 | ;; 1156 | # This must come after -sysvr4. 1157 | -sysv*) 1158 | ;; 1159 | -ose*) 1160 | os=-ose 1161 | ;; 1162 | -es1800*) 1163 | os=-ose 1164 | ;; 1165 | -xenix) 1166 | os=-xenix 1167 | ;; 1168 | -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1169 | os=-mint 1170 | ;; 1171 | -none) 1172 | ;; 1173 | *) 1174 | # Get rid of the `-' at the beginning of $os. 1175 | os=`echo $os | sed 's/[^-]*-//'` 1176 | echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 1177 | exit 1 1178 | ;; 1179 | esac 1180 | else 1181 | 1182 | # Here we handle the default operating systems that come with various machines. 1183 | # The value should be what the vendor currently ships out the door with their 1184 | # machine or put another way, the most popular os provided with the machine. 1185 | 1186 | # Note that if you're going to try to match "-MANUFACTURER" here (say, 1187 | # "-sun"), then you have to tell the case statement up towards the top 1188 | # that MANUFACTURER isn't an operating system. Otherwise, code above 1189 | # will signal an error saying that MANUFACTURER isn't an operating 1190 | # system, and we'll never get to this point. 1191 | 1192 | case $basic_machine in 1193 | *-acorn) 1194 | os=-riscix1.2 1195 | ;; 1196 | arm*-rebel) 1197 | os=-linux 1198 | ;; 1199 | arm*-semi) 1200 | os=-aout 1201 | ;; 1202 | pdp10-*) 1203 | os=-tops20 1204 | ;; 1205 | pdp11-*) 1206 | os=-none 1207 | ;; 1208 | *-dec | vax-*) 1209 | os=-ultrix4.2 1210 | ;; 1211 | m68*-apollo) 1212 | os=-domain 1213 | ;; 1214 | i386-sun) 1215 | os=-sunos4.0.2 1216 | ;; 1217 | m68000-sun) 1218 | os=-sunos3 1219 | # This also exists in the configure program, but was not the 1220 | # default. 1221 | # os=-sunos4 1222 | ;; 1223 | m68*-cisco) 1224 | os=-aout 1225 | ;; 1226 | mips*-cisco) 1227 | os=-elf 1228 | ;; 1229 | mips*-*) 1230 | os=-elf 1231 | ;; 1232 | *-tti) # must be before sparc entry or we get the wrong os. 1233 | os=-sysv3 1234 | ;; 1235 | sparc-* | *-sun) 1236 | os=-sunos4.1.1 1237 | ;; 1238 | *-be) 1239 | os=-beos 1240 | ;; 1241 | *-ibm) 1242 | os=-aix 1243 | ;; 1244 | *-wec) 1245 | os=-proelf 1246 | ;; 1247 | *-winbond) 1248 | os=-proelf 1249 | ;; 1250 | *-oki) 1251 | os=-proelf 1252 | ;; 1253 | *-hp) 1254 | os=-hpux 1255 | ;; 1256 | *-hitachi) 1257 | os=-hiux 1258 | ;; 1259 | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) 1260 | os=-sysv 1261 | ;; 1262 | *-cbm) 1263 | os=-amigaos 1264 | ;; 1265 | *-dg) 1266 | os=-dgux 1267 | ;; 1268 | *-dolphin) 1269 | os=-sysv3 1270 | ;; 1271 | m68k-ccur) 1272 | os=-rtu 1273 | ;; 1274 | m88k-omron*) 1275 | os=-luna 1276 | ;; 1277 | *-next ) 1278 | os=-nextstep 1279 | ;; 1280 | *-sequent) 1281 | os=-ptx 1282 | ;; 1283 | *-crds) 1284 | os=-unos 1285 | ;; 1286 | *-ns) 1287 | os=-genix 1288 | ;; 1289 | i370-*) 1290 | os=-mvs 1291 | ;; 1292 | *-next) 1293 | os=-nextstep3 1294 | ;; 1295 | *-gould) 1296 | os=-sysv 1297 | ;; 1298 | *-highlevel) 1299 | os=-bsd 1300 | ;; 1301 | *-encore) 1302 | os=-bsd 1303 | ;; 1304 | *-sgi) 1305 | os=-irix 1306 | ;; 1307 | *-siemens) 1308 | os=-sysv4 1309 | ;; 1310 | *-masscomp) 1311 | os=-rtu 1312 | ;; 1313 | f30[01]-fujitsu | f700-fujitsu) 1314 | os=-uxpv 1315 | ;; 1316 | *-rom68k) 1317 | os=-coff 1318 | ;; 1319 | *-*bug) 1320 | os=-coff 1321 | ;; 1322 | *-apple) 1323 | os=-macos 1324 | ;; 1325 | *-atari*) 1326 | os=-mint 1327 | ;; 1328 | *) 1329 | os=-none 1330 | ;; 1331 | esac 1332 | fi 1333 | 1334 | # Here we handle the case where we know the os, and the CPU type, but not the 1335 | # manufacturer. We pick the logical manufacturer. 1336 | vendor=unknown 1337 | case $basic_machine in 1338 | *-unknown) 1339 | case $os in 1340 | -riscix*) 1341 | vendor=acorn 1342 | ;; 1343 | -sunos*) 1344 | vendor=sun 1345 | ;; 1346 | -aix*) 1347 | vendor=ibm 1348 | ;; 1349 | -beos*) 1350 | vendor=be 1351 | ;; 1352 | -hpux*) 1353 | vendor=hp 1354 | ;; 1355 | -mpeix*) 1356 | vendor=hp 1357 | ;; 1358 | -hiux*) 1359 | vendor=hitachi 1360 | ;; 1361 | -unos*) 1362 | vendor=crds 1363 | ;; 1364 | -dgux*) 1365 | vendor=dg 1366 | ;; 1367 | -luna*) 1368 | vendor=omron 1369 | ;; 1370 | -genix*) 1371 | vendor=ns 1372 | ;; 1373 | -mvs* | -opened*) 1374 | vendor=ibm 1375 | ;; 1376 | -ptx*) 1377 | vendor=sequent 1378 | ;; 1379 | -vxsim* | -vxworks*) 1380 | vendor=wrs 1381 | ;; 1382 | -aux*) 1383 | vendor=apple 1384 | ;; 1385 | -hms*) 1386 | vendor=hitachi 1387 | ;; 1388 | -mpw* | -macos*) 1389 | vendor=apple 1390 | ;; 1391 | -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) 1392 | vendor=atari 1393 | ;; 1394 | -vos*) 1395 | vendor=stratus 1396 | ;; 1397 | esac 1398 | basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` 1399 | ;; 1400 | esac 1401 | 1402 | echo $basic_machine$os 1403 | exit 0 1404 | 1405 | # Local variables: 1406 | # eval: (add-hook 'write-file-hooks 'time-stamp) 1407 | # time-stamp-start: "timestamp='" 1408 | # time-stamp-format: "%:y-%02m-%02d" 1409 | # time-stamp-end: "'" 1410 | # End: 1411 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl dhcprobe configure.in. Scary... very scary. 3 | dnl 4 | 5 | #AC_INIT(dhcprobe.c) 6 | AC_INIT([dhcprobe], [1.2]) 7 | 8 | AC_PROG_CC 9 | AC_PROG_INSTALL 10 | 11 | dnl 12 | dnl some libs sunos/solaris needs 13 | dnl 14 | AC_CANONICAL_SYSTEM 15 | case "$target_os" in 16 | sunos*) 17 | AC_DEFINE(SUNOS) 18 | AC_CHECK_LIB(socket,main) 19 | AC_CHECK_LIB(nsl,main) 20 | AC_CHECK_LIB(resolv,main) 21 | OS_OPT= 22 | AC_SUBST(OS_OPT) 23 | ;; 24 | solaris*) 25 | AC_DEFINE(SUNOS) 26 | AC_CHECK_LIB(socket,main) 27 | AC_CHECK_LIB(nsl,main) 28 | AC_CHECK_LIB(resolv,main) 29 | OS_OPT= 30 | AC_SUBST(OS_OPT) 31 | ;; 32 | esac 33 | 34 | #AM_INIT_AUTOMAKE(dhcprobe, 1.2) 35 | AC_CONFIG_SRCDIR([dhcprobe.c]) 36 | AM_INIT_AUTOMAKE 37 | 38 | 39 | AC_HEADER_STDC 40 | AC_HEADER_TIME 41 | AC_CHECK_HEADERS([netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h]) 42 | 43 | AC_CHECK_FUNCS([gethostbyname memset select socket]) 44 | 45 | AC_OUTPUT(Makefile) 46 | -------------------------------------------------------------------------------- /depcomp: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # depcomp - compile a program generating dependencies as side-effects 4 | # Copyright 1999, 2000 Free Software Foundation, Inc. 5 | 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2, or (at your option) 9 | # any later version. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 19 | # 02111-1307, USA. 20 | 21 | # As a special exception to the GNU General Public License, if you 22 | # distribute this file as part of a program that contains a 23 | # configuration script generated by Autoconf, you may include it under 24 | # the same distribution terms that you use for the rest of that program. 25 | 26 | # Originally written by Alexandre Oliva . 27 | 28 | if test -z "$depmode" || test -z "$source" || test -z "$object"; then 29 | echo "depcomp: Variables source, object and depmode must be set" 1>&2 30 | exit 1 31 | fi 32 | # `libtool' can also be set to `yes' or `no'. 33 | 34 | depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} 35 | tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} 36 | 37 | rm -f "$tmpdepfile" 38 | 39 | # Some modes work just like other modes, but use different flags. We 40 | # parameterize here, but still list the modes in the big case below, 41 | # to make depend.m4 easier to write. Note that we *cannot* use a case 42 | # here, because this file can only contain one case statement. 43 | if test "$depmode" = hp; then 44 | # HP compiler uses -M and no extra arg. 45 | gccflag=-M 46 | depmode=gcc 47 | fi 48 | 49 | if test "$depmode" = dashXmstdout; then 50 | # This is just like dashmstdout with a different argument. 51 | dashmflag=-xM 52 | depmode=dashmstdout 53 | fi 54 | 55 | case "$depmode" in 56 | gcc3) 57 | ## gcc 3 implements dependency tracking that does exactly what 58 | ## we want. Yay! Note: for some reason libtool 1.4 doesn't like 59 | ## it if -MD -MP comes after the -MF stuff. Hmm. 60 | "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" 61 | stat=$? 62 | if test $stat -eq 0; then : 63 | else 64 | rm -f "$tmpdepfile" 65 | exit $stat 66 | fi 67 | mv "$tmpdepfile" "$depfile" 68 | ;; 69 | 70 | gcc) 71 | ## There are various ways to get dependency output from gcc. Here's 72 | ## why we pick this rather obscure method: 73 | ## - Don't want to use -MD because we'd like the dependencies to end 74 | ## up in a subdir. Having to rename by hand is ugly. 75 | ## (We might end up doing this anyway to support other compilers.) 76 | ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like 77 | ## -MM, not -M (despite what the docs say). 78 | ## - Using -M directly means running the compiler twice (even worse 79 | ## than renaming). 80 | if test -z "$gccflag"; then 81 | gccflag=-MD, 82 | fi 83 | "$@" -Wp,"$gccflag$tmpdepfile" 84 | stat=$? 85 | if test $stat -eq 0; then : 86 | else 87 | rm -f "$tmpdepfile" 88 | exit $stat 89 | fi 90 | rm -f "$depfile" 91 | echo "$object : \\" > "$depfile" 92 | alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 93 | ## The second -e expression handles DOS-style file names with drive letters. 94 | sed -e 's/^[^:]*: / /' \ 95 | -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" 96 | ## This next piece of magic avoids the `deleted header file' problem. 97 | ## The problem is that when a header file which appears in a .P file 98 | ## is deleted, the dependency causes make to die (because there is 99 | ## typically no way to rebuild the header). We avoid this by adding 100 | ## dummy dependencies for each header file. Too bad gcc doesn't do 101 | ## this for us directly. 102 | tr ' ' ' 103 | ' < "$tmpdepfile" | 104 | ## Some versions of gcc put a space before the `:'. On the theory 105 | ## that the space means something, we add a space to the output as 106 | ## well. 107 | ## Some versions of the HPUX 10.20 sed can't process this invocation 108 | ## correctly. Breaking it into two sed invocations is a workaround. 109 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 110 | rm -f "$tmpdepfile" 111 | ;; 112 | 113 | hp) 114 | # This case exists only to let depend.m4 do its work. It works by 115 | # looking at the text of this script. This case will never be run, 116 | # since it is checked for above. 117 | exit 1 118 | ;; 119 | 120 | sgi) 121 | if test "$libtool" = yes; then 122 | "$@" "-Wp,-MDupdate,$tmpdepfile" 123 | else 124 | "$@" -MDupdate "$tmpdepfile" 125 | fi 126 | stat=$? 127 | if test $stat -eq 0; then : 128 | else 129 | rm -f "$tmpdepfile" 130 | exit $stat 131 | fi 132 | rm -f "$depfile" 133 | 134 | if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files 135 | echo "$object : \\" > "$depfile" 136 | 137 | # Clip off the initial element (the dependent). Don't try to be 138 | # clever and replace this with sed code, as IRIX sed won't handle 139 | # lines with more than a fixed number of characters (4096 in 140 | # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; 141 | # the IRIX cc adds comments like `#:fec' to the end of the 142 | # dependency line. 143 | tr ' ' ' 144 | ' < "$tmpdepfile" \ 145 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ 146 | tr ' 147 | ' ' ' >> $depfile 148 | echo >> $depfile 149 | 150 | # The second pass generates a dummy entry for each header file. 151 | tr ' ' ' 152 | ' < "$tmpdepfile" \ 153 | | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ 154 | >> $depfile 155 | else 156 | # The sourcefile does not contain any dependencies, so just 157 | # store a dummy comment line, to avoid errors with the Makefile 158 | # "include basename.Plo" scheme. 159 | echo "#dummy" > "$depfile" 160 | fi 161 | rm -f "$tmpdepfile" 162 | ;; 163 | 164 | aix) 165 | # The C for AIX Compiler uses -M and outputs the dependencies 166 | # in a .u file. This file always lives in the current directory. 167 | # Also, the AIX compiler puts `$object:' at the start of each line; 168 | # $object doesn't have directory information. 169 | stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` 170 | tmpdepfile="$stripped.u" 171 | outname="$stripped.o" 172 | if test "$libtool" = yes; then 173 | "$@" -Wc,-M 174 | else 175 | "$@" -M 176 | fi 177 | 178 | stat=$? 179 | if test $stat -eq 0; then : 180 | else 181 | rm -f "$tmpdepfile" 182 | exit $stat 183 | fi 184 | 185 | if test -f "$tmpdepfile"; then 186 | # Each line is of the form `foo.o: dependent.h'. 187 | # Do two passes, one to just change these to 188 | # `$object: dependent.h' and one to simply `dependent.h:'. 189 | sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" 190 | sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" 191 | else 192 | # The sourcefile does not contain any dependencies, so just 193 | # store a dummy comment line, to avoid errors with the Makefile 194 | # "include basename.Plo" scheme. 195 | echo "#dummy" > "$depfile" 196 | fi 197 | rm -f "$tmpdepfile" 198 | ;; 199 | 200 | tru64) 201 | # The Tru64 AIX compiler uses -MD to generate dependencies as a side 202 | # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. 203 | # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put 204 | # dependencies in `foo.d' instead, so we check for that too. 205 | # Subdirectories are respected. 206 | 207 | tmpdepfile1="$object.d" 208 | tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` 209 | if test "$libtool" = yes; then 210 | "$@" -Wc,-MD 211 | else 212 | "$@" -MD 213 | fi 214 | 215 | stat=$? 216 | if test $stat -eq 0; then : 217 | else 218 | rm -f "$tmpdepfile1" "$tmpdepfile2" 219 | exit $stat 220 | fi 221 | 222 | if test -f "$tmpdepfile1"; then 223 | tmpdepfile="$tmpdepfile1" 224 | else 225 | tmpdepfile="$tmpdepfile2" 226 | fi 227 | if test -f "$tmpdepfile"; then 228 | sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" 229 | # That's a space and a tab in the []. 230 | sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" 231 | else 232 | echo "#dummy" > "$depfile" 233 | fi 234 | rm -f "$tmpdepfile" 235 | ;; 236 | 237 | #nosideeffect) 238 | # This comment above is used by automake to tell side-effect 239 | # dependency tracking mechanisms from slower ones. 240 | 241 | dashmstdout) 242 | # Important note: in order to support this mode, a compiler *must* 243 | # always write the proprocessed file to stdout, regardless of -o, 244 | # because we must use -o when running libtool. 245 | test -z "$dashmflag" && dashmflag=-M 246 | ( IFS=" " 247 | case " $* " in 248 | *" --mode=compile "*) # this is libtool, let us make it quiet 249 | for arg 250 | do # cycle over the arguments 251 | case "$arg" in 252 | "--mode=compile") 253 | # insert --quiet before "--mode=compile" 254 | set fnord "$@" --quiet 255 | shift # fnord 256 | ;; 257 | esac 258 | set fnord "$@" "$arg" 259 | shift # fnord 260 | shift # "$arg" 261 | done 262 | ;; 263 | esac 264 | "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" 265 | ) & 266 | proc=$! 267 | "$@" 268 | stat=$? 269 | wait "$proc" 270 | if test "$stat" != 0; then exit $stat; fi 271 | rm -f "$depfile" 272 | cat < "$tmpdepfile" > "$depfile" 273 | tr ' ' ' 274 | ' < "$tmpdepfile" | \ 275 | ## Some versions of the HPUX 10.20 sed can't process this invocation 276 | ## correctly. Breaking it into two sed invocations is a workaround. 277 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 278 | rm -f "$tmpdepfile" 279 | ;; 280 | 281 | dashXmstdout) 282 | # This case only exists to satisfy depend.m4. It is never actually 283 | # run, as this mode is specially recognized in the preamble. 284 | exit 1 285 | ;; 286 | 287 | makedepend) 288 | # X makedepend 289 | ( 290 | shift 291 | cleared=no 292 | for arg in "$@"; do 293 | case $cleared in no) 294 | set ""; shift 295 | cleared=yes 296 | esac 297 | case "$arg" in 298 | -D*|-I*) 299 | set fnord "$@" "$arg"; shift;; 300 | -*) 301 | ;; 302 | *) 303 | set fnord "$@" "$arg"; shift;; 304 | esac 305 | done 306 | obj_suffix="`echo $object | sed 's/^.*\././'`" 307 | touch "$tmpdepfile" 308 | ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" 309 | ) & 310 | proc=$! 311 | "$@" 312 | stat=$? 313 | wait "$proc" 314 | if test "$stat" != 0; then exit $stat; fi 315 | rm -f "$depfile" 316 | cat < "$tmpdepfile" > "$depfile" 317 | tail +3 "$tmpdepfile" | tr ' ' ' 318 | ' | \ 319 | ## Some versions of the HPUX 10.20 sed can't process this invocation 320 | ## correctly. Breaking it into two sed invocations is a workaround. 321 | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" 322 | rm -f "$tmpdepfile" "$tmpdepfile".bak 323 | ;; 324 | 325 | cpp) 326 | # Important note: in order to support this mode, a compiler *must* 327 | # always write the proprocessed file to stdout, regardless of -o, 328 | # because we must use -o when running libtool. 329 | ( IFS=" " 330 | case " $* " in 331 | *" --mode=compile "*) 332 | for arg 333 | do # cycle over the arguments 334 | case $arg in 335 | "--mode=compile") 336 | # insert --quiet before "--mode=compile" 337 | set fnord "$@" --quiet 338 | shift # fnord 339 | ;; 340 | esac 341 | set fnord "$@" "$arg" 342 | shift # fnord 343 | shift # "$arg" 344 | done 345 | ;; 346 | esac 347 | "$@" -E | 348 | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | 349 | sed '$ s: \\$::' > "$tmpdepfile" 350 | ) & 351 | proc=$! 352 | "$@" 353 | stat=$? 354 | wait "$proc" 355 | if test "$stat" != 0; then exit $stat; fi 356 | rm -f "$depfile" 357 | echo "$object : \\" > "$depfile" 358 | cat < "$tmpdepfile" >> "$depfile" 359 | sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" 360 | rm -f "$tmpdepfile" 361 | ;; 362 | 363 | msvisualcpp) 364 | # Important note: in order to support this mode, a compiler *must* 365 | # always write the proprocessed file to stdout, regardless of -o, 366 | # because we must use -o when running libtool. 367 | ( IFS=" " 368 | case " $* " in 369 | *" --mode=compile "*) 370 | for arg 371 | do # cycle over the arguments 372 | case $arg in 373 | "--mode=compile") 374 | # insert --quiet before "--mode=compile" 375 | set fnord "$@" --quiet 376 | shift # fnord 377 | ;; 378 | esac 379 | set fnord "$@" "$arg" 380 | shift # fnord 381 | shift # "$arg" 382 | done 383 | ;; 384 | esac 385 | "$@" -E | 386 | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" 387 | ) & 388 | proc=$! 389 | "$@" 390 | stat=$? 391 | wait "$proc" 392 | if test "$stat" != 0; then exit $stat; fi 393 | rm -f "$depfile" 394 | echo "$object : \\" > "$depfile" 395 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" 396 | echo " " >> "$depfile" 397 | . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" 398 | rm -f "$tmpdepfile" 399 | ;; 400 | 401 | none) 402 | exec "$@" 403 | ;; 404 | 405 | *) 406 | echo "Unknown depmode $depmode" 1>&2 407 | exit 1 408 | ;; 409 | esac 410 | 411 | exit 0 412 | -------------------------------------------------------------------------------- /dhcp_options.h: -------------------------------------------------------------------------------- 1 | // 2 | // $Id: dhcp_options.h,v 1.1 2001/08/24 00:36:50 mavetju Exp $ 3 | // 4 | 5 | char *dhcp_options[]={ 6 | "", 7 | /* 1 */ "Subnet mask", 8 | /* 2 */ "", 9 | /* 3 */ "Router", 10 | /* 4 */ "Time Server", 11 | /* 5 */ "", 12 | /* 6 */ "DNS server", 13 | /* 7 */ "", 14 | /* 8 */ "", 15 | /* 9 */ "", 16 | /* 10 */ "", 17 | /* 11 */ "", 18 | /* 12 */ "", 19 | /* 13 */ "", 20 | /* 14 */ "", 21 | /* 15 */ "Domain name", 22 | /* 16 */ "", 23 | /* 17 */ "", 24 | /* 18 */ "", 25 | /* 19 */ "", 26 | /* 20 */ "", 27 | /* 21 */ "", 28 | /* 22 */ "", 29 | /* 23 */ "", 30 | /* 24 */ "", 31 | /* 25 */ "", 32 | /* 26 */ "", 33 | /* 27 */ "", 34 | /* 28 */ "Broadcast", 35 | /* 29 */ "", 36 | /* 30 */ "", 37 | /* 31 */ "", 38 | /* 32 */ "", 39 | /* 33 */ "", 40 | /* 34 */ "", 41 | /* 35 */ "", 42 | /* 36 */ "", 43 | /* 37 */ "", 44 | /* 38 */ "", 45 | /* 39 */ "", 46 | /* 40 */ "", 47 | /* 41 */ "", 48 | /* 42 */ "NTP Server", 49 | /* 43 */ "", 50 | /* 44 */ "Netbios Nameserver", 51 | /* 45 */ "", 52 | /* 46 */ "", 53 | /* 47 */ "", 54 | /* 48 */ "", 55 | /* 49 */ "", 56 | /* 50 */ "Request IP address", 57 | /* 51 */ "IP address leasetime", 58 | /* 52 */ "", 59 | /* 53 */ "DHCP message type", 60 | /* 54 */ "Server identifier", 61 | /* 55 */ "", 62 | /* 56 */ "Message", 63 | /* 57 */ "", 64 | /* 58 */ "T1", 65 | /* 59 */ "T2", 66 | /* 60 */ "", 67 | /* 61 */ "Client-identifier", 68 | /* 62 */ "", 69 | /* 63 */ "", 70 | /* 64 */ "", 71 | /* 65 */ "", 72 | /* 66 */ "", 73 | /* 67 */ "", 74 | /* 68 */ "", 75 | /* 69 */ "", 76 | /* 70 */ "", 77 | /* 71 */ "", 78 | /* 72 */ "", 79 | /* 73 */ "", 80 | /* 74 */ "", 81 | /* 75 */ "", 82 | /* 76 */ "", 83 | /* 77 */ "", 84 | /* 78 */ "", 85 | /* 79 */ "", 86 | /* 80 */ "", 87 | /* 81 */ "", 88 | /* 82 */ "", 89 | /* 83 */ "", 90 | /* 84 */ "", 91 | /* 85 */ "", 92 | /* 86 */ "", 93 | /* 87 */ "", 94 | /* 88 */ "", 95 | /* 89 */ "", 96 | /* 90 */ "", 97 | /* 91 */ "", 98 | /* 92 */ "", 99 | /* 93 */ "", 100 | /* 94 */ "", 101 | /* 95 */ "", 102 | /* 96 */ "", 103 | /* 97 */ "", 104 | /* 98 */ "", 105 | /* 99 */ "", 106 | /* 100 */ "", 107 | /* 101 */ "", 108 | /* 102 */ "", 109 | /* 103 */ "", 110 | /* 104 */ "", 111 | /* 105 */ "", 112 | /* 106 */ "", 113 | /* 107 */ "", 114 | /* 108 */ "", 115 | /* 109 */ "", 116 | /* 110 */ "", 117 | /* 111 */ "", 118 | /* 112 */ "", 119 | /* 113 */ "", 120 | /* 114 */ "", 121 | /* 115 */ "", 122 | /* 116 */ "", 123 | /* 117 */ "", 124 | /* 118 */ "", 125 | /* 119 */ "", 126 | /* 120 */ "", 127 | /* 121 */ "", 128 | /* 122 */ "", 129 | /* 123 */ "", 130 | /* 124 */ "", 131 | /* 125 */ "", 132 | /* 126 */ "", 133 | /* 127 */ "", 134 | /* 128 */ "", 135 | /* 129 */ "", 136 | /* 130 */ "", 137 | /* 131 */ "", 138 | /* 132 */ "", 139 | /* 133 */ "", 140 | /* 134 */ "", 141 | /* 135 */ "", 142 | /* 136 */ "", 143 | /* 137 */ "", 144 | /* 138 */ "", 145 | /* 139 */ "", 146 | /* 140 */ "", 147 | /* 141 */ "", 148 | /* 142 */ "", 149 | /* 143 */ "", 150 | /* 144 */ "", 151 | /* 145 */ "", 152 | /* 146 */ "", 153 | /* 147 */ "", 154 | /* 148 */ "", 155 | /* 149 */ "", 156 | /* 150 */ "", 157 | /* 151 */ "", 158 | /* 152 */ "", 159 | /* 153 */ "", 160 | /* 154 */ "", 161 | /* 155 */ "", 162 | /* 156 */ "", 163 | /* 157 */ "", 164 | /* 158 */ "", 165 | /* 159 */ "", 166 | /* 160 */ "", 167 | /* 161 */ "", 168 | /* 162 */ "", 169 | /* 163 */ "", 170 | /* 164 */ "", 171 | /* 165 */ "", 172 | /* 166 */ "", 173 | /* 167 */ "", 174 | /* 168 */ "", 175 | /* 169 */ "", 176 | /* 170 */ "", 177 | /* 171 */ "", 178 | /* 172 */ "", 179 | /* 173 */ "", 180 | /* 174 */ "", 181 | /* 175 */ "", 182 | /* 176 */ "", 183 | /* 177 */ "", 184 | /* 178 */ "", 185 | /* 179 */ "", 186 | /* 180 */ "", 187 | /* 181 */ "", 188 | /* 182 */ "", 189 | /* 183 */ "", 190 | /* 184 */ "", 191 | /* 185 */ "", 192 | /* 186 */ "", 193 | /* 187 */ "", 194 | /* 188 */ "", 195 | /* 189 */ "", 196 | /* 190 */ "", 197 | /* 191 */ "", 198 | /* 192 */ "", 199 | /* 193 */ "", 200 | /* 194 */ "", 201 | /* 195 */ "", 202 | /* 196 */ "", 203 | /* 197 */ "", 204 | /* 198 */ "", 205 | /* 199 */ "", 206 | /* 200 */ "", 207 | /* 201 */ "", 208 | /* 202 */ "", 209 | /* 203 */ "", 210 | /* 204 */ "", 211 | /* 205 */ "", 212 | /* 206 */ "", 213 | /* 207 */ "", 214 | /* 208 */ "", 215 | /* 209 */ "", 216 | /* 210 */ "", 217 | /* 211 */ "", 218 | /* 212 */ "", 219 | /* 213 */ "", 220 | /* 214 */ "", 221 | /* 215 */ "", 222 | /* 216 */ "", 223 | /* 217 */ "", 224 | /* 218 */ "", 225 | /* 219 */ "", 226 | /* 220 */ "", 227 | /* 221 */ "", 228 | /* 222 */ "", 229 | /* 223 */ "", 230 | /* 224 */ "", 231 | /* 225 */ "", 232 | /* 226 */ "", 233 | /* 227 */ "", 234 | /* 228 */ "", 235 | /* 229 */ "", 236 | /* 230 */ "", 237 | /* 231 */ "", 238 | /* 232 */ "", 239 | /* 233 */ "", 240 | /* 234 */ "", 241 | /* 235 */ "", 242 | /* 236 */ "", 243 | /* 237 */ "", 244 | /* 238 */ "", 245 | /* 239 */ "", 246 | /* 240 */ "", 247 | /* 241 */ "", 248 | /* 242 */ "", 249 | /* 243 */ "", 250 | /* 244 */ "", 251 | /* 245 */ "", 252 | /* 246 */ "", 253 | /* 247 */ "", 254 | /* 248 */ "", 255 | /* 249 */ "", 256 | /* 250 */ "", 257 | /* 251 */ "", 258 | /* 252 */ "WPAD Server", 259 | /* 253 */ "", 260 | /* 254 */ "", 261 | /* 255 */ "End"}; 262 | 263 | 264 | char *dhcp_message_types[]={ 265 | "", 266 | /* 1 */ "DHCPDISCOVER", 267 | /* 2 */ "DHCPOFFER", 268 | /* 3 */ "DHCPREQUEST", 269 | /* 4 */ "DHCPDECLINE", 270 | /* 5 */ "DHCPACK", 271 | /* 6 */ "DHCPNAK", 272 | /* 7 */ "DHCPRELEASE", 273 | /* 8 */ "DHCPINFORM"}; 274 | -------------------------------------------------------------------------------- /dhcprobe.8: -------------------------------------------------------------------------------- 1 | .\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) 2 | .\" 3 | .\" Standard preamble: 4 | .\" ======================================================================== 5 | .de Sp \" Vertical space (when we can't use .PP) 6 | .if t .sp .5v 7 | .if n .sp 8 | .. 9 | .de Vb \" Begin verbatim text 10 | .ft CW 11 | .nf 12 | .ne \\$1 13 | .. 14 | .de Ve \" End verbatim text 15 | .ft R 16 | .fi 17 | .. 18 | .\" Set up some character translations and predefined strings. \*(-- will 19 | .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left 20 | .\" double quote, and \*(R" will give a right double quote. \*(C+ will 21 | .\" give a nicer C++. Capital omega is used to do unbreakable dashes and 22 | .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, 23 | .\" nothing in troff, for use with C<>. 24 | .tr \(*W- 25 | .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' 26 | .ie n \{\ 27 | . ds -- \(*W- 28 | . ds PI pi 29 | . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch 30 | . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch 31 | . ds L" "" 32 | . ds R" "" 33 | . ds C` "" 34 | . ds C' "" 35 | 'br\} 36 | .el\{\ 37 | . ds -- \|\(em\| 38 | . ds PI \(*p 39 | . ds L" `` 40 | . ds R" '' 41 | . ds C` 42 | . ds C' 43 | 'br\} 44 | .\" 45 | .\" Escape single quotes in literal strings from groff's Unicode transform. 46 | .ie \n(.g .ds Aq \(aq 47 | .el .ds Aq ' 48 | .\" 49 | .\" If the F register is turned on, we'll generate index entries on stderr for 50 | .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index 51 | .\" entries marked with X<> in POD. Of course, you'll have to process the 52 | .\" output yourself in some meaningful fashion. 53 | .\" 54 | .\" Avoid warning from groff about undefined register 'F'. 55 | .de IX 56 | .. 57 | .nr rF 0 58 | .if \n(.g .if rF .nr rF 1 59 | .if (\n(rF:(\n(.g==0)) \{ 60 | . if \nF \{ 61 | . de IX 62 | . tm Index:\\$1\t\\n%\t"\\$2" 63 | .. 64 | . if !\nF==2 \{ 65 | . nr % 0 66 | . nr F 2 67 | . \} 68 | . \} 69 | .\} 70 | .rr rF 71 | .\" 72 | .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). 73 | .\" Fear. Run. Save yourself. No user-serviceable parts. 74 | . \" fudge factors for nroff and troff 75 | .if n \{\ 76 | . ds #H 0 77 | . ds #V .8m 78 | . ds #F .3m 79 | . ds #[ \f1 80 | . ds #] \fP 81 | .\} 82 | .if t \{\ 83 | . ds #H ((1u-(\\\\n(.fu%2u))*.13m) 84 | . ds #V .6m 85 | . ds #F 0 86 | . ds #[ \& 87 | . ds #] \& 88 | .\} 89 | . \" simple accents for nroff and troff 90 | .if n \{\ 91 | . ds ' \& 92 | . ds ` \& 93 | . ds ^ \& 94 | . ds , \& 95 | . ds ~ ~ 96 | . ds / 97 | .\} 98 | .if t \{\ 99 | . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" 100 | . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' 101 | . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' 102 | . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' 103 | . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' 104 | . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' 105 | .\} 106 | . \" troff and (daisy-wheel) nroff accents 107 | .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' 108 | .ds 8 \h'\*(#H'\(*b\h'-\*(#H' 109 | .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] 110 | .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' 111 | .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' 112 | .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] 113 | .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] 114 | .ds ae a\h'-(\w'a'u*4/10)'e 115 | .ds Ae A\h'-(\w'A'u*4/10)'E 116 | . \" corrections for vroff 117 | .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' 118 | .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' 119 | . \" for low resolution devices (crt and lpr) 120 | .if \n(.H>23 .if \n(.V>19 \ 121 | \{\ 122 | . ds : e 123 | . ds 8 ss 124 | . ds o a 125 | . ds d- d\h'-1'\(ga 126 | . ds D- D\h'-1'\(hy 127 | . ds th \o'bp' 128 | . ds Th \o'LP' 129 | . ds ae ae 130 | . ds Ae AE 131 | .\} 132 | .rm #[ #] #H #V #F C 133 | .\" ======================================================================== 134 | .\" 135 | .IX Title "DHCPROBE 8" 136 | .TH DHCPROBE 8 "April 7, 2012" "April 7, 2012" "General Commands Manual" 137 | .\" For nroff, turn off justification. Always turn off hyphenation; it makes 138 | .\" way too many mistakes in technical documents. 139 | .if n .ad l 140 | .nh 141 | .SH "NAME" 142 | dhcprobe \- send a DHCP request to DHCP server to check its configuration 143 | .SH "SYNOPSIS" 144 | .IX Header "SYNOPSIS" 145 | \&\fBdhcprobe\fR 146 | [\fB\-v\fR] [\fB\-q\fR] [\fB\-i\fR] [\fB\-r\fR] 147 | \&\fB\-t\fR \fImaxwait\fR 148 | \&\fB\-c\fR \fIclient-IP-address\fR 149 | \&\fB\-s\fR \fIserver-IP-address\fR 150 | \&\fB\-h\fR \fIclient-hardware-address\fR 151 | [\fB\-g\fR \fIgateway-IP-address\fR] 152 | .SH "DESCRIPTION" 153 | .IX Header "DESCRIPTION" 154 | This command allows the system administrator to check if a remote 155 | \&\s-1DHCP\s0 server is still functioning. 156 | .PP 157 | Options are: 158 | .IP "\fB\-v\fR" 4 159 | .IX Item "-v" 160 | Verbose, print more information. Apply multiple times to see \s-1DHCP\s0 configuration details, connecting progress and the package in hex format. 161 | .IP "\fB\-i\fR" 4 162 | .IX Item "-i" 163 | Use \s-1DHCPINFORM\s0 packets. 164 | .IP "\fB\-r\fR" 4 165 | .IX Item "-r" 166 | Use \s-1DHCPREQUEST\s0 packets (default behaviour). 167 | .IP "\fB\-q\fR" 4 168 | .IX Item "-q" 169 | Quiet, print nothing on the screen. 170 | .IP "\fB\-t\fR \fImaxwait\fR" 4 171 | .IX Item "-t maxwait" 172 | Maximum time to wait for an answer from the server in seconds. 173 | Default is 3 seconds. 174 | .IP "\fB\-c\fR \fIclient-IP-address\fR" 4 175 | .IX Item "-c client-IP-address" 176 | Request this \s-1IP\s0 address. Note that this is also the \s-1IP\s0 address the 177 | answer will be sent to. 178 | .IP "\fB\-s\fR \fIserver-IP-address\fR" 4 179 | .IX Item "-s server-IP-address" 180 | Send the \s-1DHCP\s0 packet to this \s-1IP\s0 address. 181 | .IP "\fB\-h\fR \fIclient-hardware-address\fR" 4 182 | .IX Item "-h client-hardware-address" 183 | Use this hardware-address in the \s-1DHCP\s0 request. It can be up to 184 | sixteen octets seperated by colons (i.e. 01:02:03:04) 185 | .IP "\fB\-g\fR \fIgateway-IP-address\fR" 4 186 | .IX Item "-g gateway-IP-address" 187 | Use this \s-1IP\s0 address for the gateway \s-1IP\s0 address in the \s-1DHCP\s0 packet. 188 | This option is currently broken. 189 | .SH "RETURN VALUES" 190 | .IX Header "RETURN VALUES" 191 | If everything goes okay, it returns 0. If there went something 192 | wrong, it returns 1. 193 | .SH "SETUP" 194 | .IX Header "SETUP" 195 | This program should be installed setuid root or ran by root only. 196 | See \s-1SECURITY\s0 for more information. 197 | .PP 198 | On your \s-1DHCP\s0 server, add these lines to the dhcpd.conf: 199 | .PP 200 | .Vb 4 201 | \& host { 202 | \& hardware ethernet ; 203 | \& fixed\-address ; 204 | \& } 205 | .Ve 206 | .PP 207 | Then try it: 208 | .PP 209 | $ dhcprobe \-c \fIyour monitoring host \s-1IP\s0 address\fR \e 210 | \-s \fIyour \s-1DHCP\s0 server \s-1IP\s0 address\fR \e 211 | \-h \fIyour monitor host mac address\fR 212 | .PP 213 | It will either respond with \*(L"no answer\*(R" or "Got answer from: \fIyour 214 | \&\s-1DHCP\s0 server \s-1IP\s0 address\fR" 215 | .PP 216 | The \s-1DHCP\s0 server logfile will give: 217 | \s-1DHCPREQUEST\s0\ for\ 192.168.1.1\ from\ 00:20:18:56:29:8f\ via\ ed0 218 | \s-1DHCPACK\s0\ on\ 192.168.1.1\ to\ 00:20:18:56:29:8f\ via\ ed0 219 | \s-1DHCPRELEASE\s0\ of\ 192.168.1.1\ from\ 00:20:18:56:29:8f\ via\ ed0\ (found) 220 | .PP 221 | Running in \s-1DHCPINFORM\s0 mode with \fB\-i\fR: 222 | .PP 223 | If you see \*(L"\s-1DHCPINFORM\s0 from 192.168.1.1 via xl0: not authoritative 224 | for subnet 192.168.1.0\*(R", you should add the authoritative statement 225 | to the subnet, See \fIdhcpd.conf\fR\|(5) for details. 226 | .PP 227 | When running in very verbose mode, \fBdhcprobe\fR tries to dump all 228 | data of the send and received \s-1DHCP\s0 packets. It will first dump the 229 | packet in hex-format, then decodes the header and finally the 230 | options. 231 | .SH "HOW IT WORKS" 232 | .IX Header "HOW IT WORKS" 233 | The client either sends a \s-1DHCPREQUEST\s0 or \s-1DHCPINFORM\s0 packet to the 234 | server and waits for an answer. Then, if a \s-1DHCPREQUEST\s0 was send, 235 | it will send a \s-1DHCPRELEASE\s0 back to the server. 236 | .SH "SECURITY" 237 | .IX Header "SECURITY" 238 | This program is installed setuid root as it requires the privileges 239 | to bind itself to port 68 (bootpc). Root privileges are dropped as 240 | soon as the program has bound itself to that port. 241 | .SH "BUGS" 242 | .IX Header "BUGS" 243 | Currently (this may, or may not, change in the future) the \s-1ISC DHCP\s0 244 | daemon does not write leases with a fixed \s-1IP\s0 address in the 245 | dhcpd.leases file. 246 | .PP 247 | \&\s-1DHCPINFORM\s0 packets can only be used on subnets the server is authori\- 248 | tative for. If the monitoring script runs on a subnet the server 249 | isn't authoritative for, it should use the \s-1DHCPREQUEST\s0 packets. I 250 | also experienced some problems with \s-1ISC DHCPD\s0 v2 servers, but that 251 | is also in the \s-1README\s0 of it. 252 | .PP 253 | The \fB\-V\fR option is still working, but shouldn't be used for 254 | debugging of the packets. Better use \fIdhcpdump\fR\|(8) for that, which 255 | is available on my website. I wanted to remove it, but decided only 256 | to do it from the documentation, not from the code. Maybe I'll need 257 | it one day for debugging. 258 | .SH "AUTHOR" 259 | .IX Header "AUTHOR" 260 | Edwin Groothuis, edwin@mavetju.org (http://www.mavetju.org) 261 | Johannes Buchner, buchner.johannes@gmx.at (https://github.com/JohannesBuchner/DHCProbe) 262 | .SH "SEE ALSO" 263 | .IX Header "SEE ALSO" 264 | \&\fIdhcpd\fR\|(8), \fIdhclient\fR\|(8), \fIdhcpd.conf\fR\|(5), \fIdhcpdump\fR\|(8) 265 | -------------------------------------------------------------------------------- /dhcprobe.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2000, 2001, 2002 by Edwin Groothuis, edwin@mavetju.org 3 | * Copyright 2012 by Johannes Buchner, buchner.johannes@gmx.at 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | */ 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #include "dhcp_options.h" 42 | 43 | #define BUF_SIZ 256*256 44 | 45 | int offset=0; 46 | void addpacket(char *pktbuf,char *msgbuf,int size) { 47 | memcpy(pktbuf+offset,msgbuf,size); 48 | offset+=size; 49 | } 50 | 51 | void dhcp_setup(char *); 52 | int dhcp_read(void); 53 | void dhcp_close(void); 54 | void dhcp_dump(unsigned char *buffer,int size); 55 | void dhcp_inform(char *ipaddr,char *gwaddr,char *hardware); 56 | void dhcp_request(char *ipaddr,char *gwaddr,char *hardware); 57 | void dhcp_release(char *ipaddr,char *gwaddr,char *hardware); 58 | void dhcp_packet(int type,char *ciaddr,char *opt50,char *gwaddr,char *hardware); 59 | 60 | int dhcp_socket; 61 | struct sockaddr_in dhcp_to; 62 | 63 | int _serveripaddress; 64 | 65 | int inform,request,verbose,quiet; 66 | char *ci,*gi,*server,*hw; 67 | unsigned char serveridentifier[4]; 68 | int maxwait=3; 69 | 70 | void doargs(int argc,char **argv) { 71 | char ch; 72 | 73 | inform=request=verbose=quiet=0; 74 | ci=gi=server="0.0.0.0"; 75 | hw="00:00:00:00:00:00"; 76 | 77 | if (argc==1) { 78 | printf("SYNAPSIS: %s -c ciaddr -g giaddr -h chaddr -r -s server -t maxwait -i -v -q\n", argv[0]); 79 | exit(1); 80 | } 81 | 82 | while ((ch = getopt(argc,argv,"c:g:h:iqrs:t:vV"))>0) { 83 | switch (ch) { 84 | case 'c': ci=optarg;break; 85 | case 'g': gi=optarg;break; 86 | case 'h': hw=optarg;break; 87 | case 'i': inform=1;break; 88 | case 'q': quiet=1;break; 89 | case 'r': request=1;break; 90 | case 's': server=optarg;break; 91 | case 't': maxwait=atoi(optarg);break; 92 | case 'v': verbose++;break; 93 | } 94 | } 95 | 96 | if (request && inform) { 97 | fprintf(stderr,"Error: -r and -i are mutally exclusive.\n"); 98 | exit(1); 99 | } 100 | 101 | // DHCPREQUEST is by default. 102 | if (!inform) request=1; 103 | } 104 | 105 | int main(int argc,char **argv) { 106 | fd_set read; 107 | struct timeval timeout; 108 | int foundpacket=0; 109 | int returnvalue=0; 110 | 111 | if (geteuid()!=0) { 112 | printf("This program should only be ran by root or be installed as setuid root.\n"); 113 | // exit(1); 114 | } 115 | 116 | doargs(argc,argv); 117 | 118 | if (verbose >= 2) puts("setup"); 119 | dhcp_setup(server); 120 | 121 | if (setuid(getuid())!=0) { 122 | perror("setuid"); 123 | printf("Can't drop privileges back to normal user, program aborted.\n"); 124 | exit(1); 125 | } 126 | 127 | if (inform) { 128 | if (verbose >= 2) puts("inform"); 129 | dhcp_inform(ci,gi,hw); 130 | } 131 | if (request) { 132 | if (verbose >= 2) puts("request"); 133 | dhcp_request(ci,gi,hw); 134 | } 135 | 136 | while (!foundpacket) { 137 | FD_ZERO(&read); 138 | FD_SET(dhcp_socket,&read); 139 | timeout.tv_sec=maxwait; 140 | timeout.tv_usec=0; 141 | if(select(dhcp_socket+1,&read,NULL,NULL,&timeout)<0) { 142 | perror("select"); 143 | exit(0); 144 | } 145 | if (FD_ISSET(dhcp_socket,&read)) { 146 | if (verbose >= 2) puts("read"); 147 | /* If a expected packet was found, then also release it. */ 148 | if ((foundpacket=dhcp_read())!=0) { 149 | if (request) { 150 | if (verbose >= 2) puts("release"); 151 | dhcp_release(ci,gi,hw); 152 | } 153 | } 154 | } else { 155 | if (!quiet) 156 | fprintf(stderr,"no answer\n"); 157 | returnvalue=1; 158 | foundpacket=1; 159 | } 160 | } 161 | if (verbose >= 2) puts("close"); 162 | dhcp_close(); 163 | return returnvalue; 164 | } 165 | 166 | 167 | void dhcp_setup(char *serveripaddress) { 168 | struct servent *servent,*clientent; 169 | struct hostent *hostent; 170 | int flag; 171 | struct sockaddr_in name; 172 | 173 | /* 174 | // setup sending socket 175 | */ 176 | if ((servent=getservbyname("bootps",0))==NULL) { 177 | perror("getservbyname: bootps"); 178 | exit(1); 179 | } 180 | if ((hostent=gethostbyname(serveripaddress))==NULL) { 181 | perror("gethostbyname"); 182 | exit(1); 183 | } 184 | 185 | dhcp_to.sin_family=AF_INET; 186 | bcopy(hostent->h_addr,&dhcp_to.sin_addr.s_addr,hostent->h_length); 187 | _serveripaddress=ntohl(dhcp_to.sin_addr.s_addr); 188 | /* dhcp_to.sin_addr.s_addr=INADDR_BROADCAST; */ 189 | dhcp_to.sin_port=servent->s_port; 190 | 191 | if ((dhcp_socket=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP))==-1) { 192 | perror("dhcp_socket/socket"); 193 | exit(1); 194 | } 195 | 196 | flag=1; 197 | if (setsockopt (dhcp_socket, SOL_SOCKET, SO_REUSEADDR, (char *)&flag, sizeof flag) < 0) { 198 | perror("dhcp_socket/setsockopt: SO_REUSEADDR"); 199 | exit(1); 200 | } 201 | 202 | if (setsockopt(dhcp_socket,SOL_SOCKET,SO_BROADCAST,(char *)&flag, sizeof flag) < 0) { 203 | perror ("dhcp_socket/setsockopt: SO_BROADCAST"); 204 | exit(1); 205 | } 206 | 207 | if ((clientent=getservbyname("bootpc",0))==NULL) { 208 | perror("getservbyname: bootpc"); 209 | exit(1); 210 | } 211 | name.sin_family = AF_INET; 212 | name.sin_port = clientent->s_port; 213 | name.sin_addr.s_addr = INADDR_ANY; 214 | /* name.sin_addr.s_addr = INADDR_NONE; */ 215 | memset (name.sin_zero, 0, sizeof (name.sin_zero)); 216 | 217 | if (bind (dhcp_socket, (struct sockaddr *)&name, sizeof name) < 0) { 218 | perror("bind"); 219 | exit(1); 220 | } 221 | } 222 | 223 | void dhcp_request(char *ipaddr,char *gwaddr,char *hardware) { 224 | dhcp_packet(3,ipaddr,ipaddr,gwaddr,hardware); 225 | } 226 | void dhcp_release(char *ipaddr,char *gwaddr,char *hardware) { 227 | dhcp_packet(7,ipaddr,NULL,gwaddr,hardware); 228 | } 229 | void dhcp_inform(char *ipaddr,char *gwaddr,char *hardware) { 230 | dhcp_packet(8,ipaddr,NULL,gwaddr,hardware); 231 | } 232 | 233 | 234 | void dhcp_packet(int type,char *ipaddr,char *opt50,char *gwaddr,char *hardware) { 235 | static time_t l=0; 236 | unsigned char msgbuf[BUF_SIZ]; 237 | unsigned char pktbuf[BUF_SIZ]; 238 | int ip[4],gw[4],hw[16],ip50[4]; 239 | int hwcount; 240 | 241 | sscanf(ipaddr,"%d.%d.%d.%d",&ip[0],&ip[1],&ip[2],&ip[3]); 242 | sscanf(gwaddr,"%d.%d.%d.%d",&gw[0],&gw[1],&gw[2],&gw[3]); 243 | if (opt50) 244 | sscanf(opt50,"%d.%d.%d.%d",&ip50[0],&ip50[1],&ip50[2],&ip50[3]); 245 | memset(&hw,0,sizeof(hw)); 246 | hwcount=sscanf(hardware,"%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x", 247 | &hw[0],&hw[1],&hw[2],&hw[3], 248 | &hw[4],&hw[5],&hw[6],&hw[7], 249 | &hw[8],&hw[9],&hw[10],&hw[11], 250 | &hw[12],&hw[13],&hw[14],&hw[15]); 251 | 252 | memset(msgbuf,0,sizeof(msgbuf)); 253 | sprintf(msgbuf,"\1\1%c%c",hwcount,0); 254 | addpacket(pktbuf,msgbuf,4); 255 | 256 | /* xid */ 257 | if (l>time(NULL)) 258 | l++; 259 | else 260 | l=time(NULL); 261 | memcpy(msgbuf,&l,4); 262 | addpacket(pktbuf,msgbuf,4); 263 | 264 | /* secs and flags */ 265 | memset(msgbuf,0,4); 266 | addpacket(pktbuf,msgbuf,4); 267 | /* sprintf(msgbuf,"%c%c",0x80,0x00); */ 268 | /* sprintf(msgbuf,"%c%c",0x00,0x00); */ 269 | /* addpacket(pktbuf,msgbuf,2); */ 270 | 271 | /* ciaddr */ 272 | memset(msgbuf,0,4); 273 | sprintf(msgbuf,"%c%c%c%c",ip[0],ip[1],ip[2],ip[3]); 274 | addpacket(pktbuf,msgbuf,4); 275 | 276 | /* yiaddr */ 277 | memset(msgbuf,0,4); 278 | addpacket(pktbuf,msgbuf,4); 279 | 280 | /* siaddr */ 281 | memset(msgbuf,0,4); 282 | addpacket(pktbuf,msgbuf,4); 283 | 284 | /* giaddr */ 285 | sprintf(msgbuf,"%c%c%c%c",gw[0],gw[1],gw[2],gw[3]); 286 | addpacket(pktbuf,msgbuf,4); 287 | 288 | /* chaddr */ 289 | sprintf(msgbuf,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", 290 | hw[0],hw[1],hw[2],hw[3],hw[4],hw[5],hw[6],hw[7], 291 | hw[8],hw[9],hw[10],hw[11],hw[12],hw[13],hw[14],hw[15]); 292 | addpacket(pktbuf,msgbuf,16); 293 | 294 | /* sname */ 295 | memset(msgbuf,0,64); 296 | addpacket(pktbuf,msgbuf,64); 297 | 298 | /* file */ 299 | memset(msgbuf,0,128); 300 | addpacket(pktbuf,msgbuf,128); 301 | 302 | /* options */ 303 | { 304 | /* cookie */ 305 | sprintf(msgbuf,"%c%c%c%c",99,130,83,99); 306 | addpacket(pktbuf,msgbuf,4); 307 | 308 | /* dhcp-type */ 309 | sprintf(msgbuf,"%c%c%c",53,1,type); 310 | addpacket(pktbuf,msgbuf,3); 311 | 312 | /* Not for inform */ 313 | if (type!=8) { 314 | /* requested IP address */ 315 | if (opt50) { 316 | sprintf(msgbuf,"%c%c%c%c%c%c",50,4,ip50[0],ip50[1],ip50[2],ip50[3]); 317 | addpacket(pktbuf,msgbuf,6); 318 | } 319 | 320 | /* server-identifier */ 321 | if (serveridentifier[0]) { 322 | sprintf(msgbuf,"%c%c%c%c%c%c",54,4, 323 | serveridentifier[0],serveridentifier[1], 324 | serveridentifier[2],serveridentifier[3]); 325 | addpacket(pktbuf,msgbuf,6); 326 | } 327 | } 328 | 329 | /* client-identifier */ 330 | // sprintf(msgbuf,"%c%c%c%c%c%c%c%c",61,6, 331 | // hw[0],hw[1],hw[2],hw[3],hw[4],hw[5]); 332 | // addpacket(pktbuf,msgbuf,8); 333 | 334 | /* parameter request list */ 335 | if (type==8) { 336 | sprintf(msgbuf,"%c%c%c",55,1,1); 337 | addpacket(pktbuf,msgbuf,3); 338 | } 339 | 340 | /* end of options */ 341 | sprintf(msgbuf,"%c",255); 342 | addpacket(pktbuf,msgbuf,1); 343 | } 344 | 345 | // dhcp_dump(pktbuf,offset); 346 | 347 | sendto(dhcp_socket,pktbuf,offset,0,(struct sockaddr *)&dhcp_to,sizeof(dhcp_to)); 348 | 349 | offset=0; 350 | } 351 | 352 | 353 | int dhcp_read(void) { 354 | unsigned char msgbuf[BUF_SIZ]; 355 | struct sockaddr_in fromsock; 356 | socklen_t fromlen=sizeof(fromsock); 357 | int addr; 358 | int i; 359 | 360 | i=recvfrom(dhcp_socket,msgbuf,BUF_SIZ,0,(struct sockaddr *)&fromsock,&fromlen); 361 | addr=ntohl(fromsock.sin_addr.s_addr); 362 | 363 | if (!quiet) { 364 | printf( "Got answer from: %d.%d.%d.%d\n", 365 | ( addr >> 24 ) & 0xFF, ( addr >> 16 ) & 0xFF, 366 | ( addr >> 8 ) & 0xFF, ( addr ) & 0xFF 367 | ); 368 | } 369 | 370 | if (_serveripaddress!=addr) { 371 | if (!quiet) 372 | fprintf(stderr,"received from %d.%d.%d.%d, expected from %d.%d.%d.%d\n", 373 | ( addr >> 24 ) & 0xFF, ( addr >> 16 ) & 0xFF, 374 | ( addr >> 8 ) & 0xFF, ( addr ) & 0xFF, 375 | ( _serveripaddress >> 24 )&0xFF,(_serveripaddress >> 16 )&0xFF, 376 | ( _serveripaddress >> 8 )&0xFF,(_serveripaddress )&0xFF 377 | ); 378 | return 0; 379 | 380 | } 381 | 382 | 383 | dhcp_dump(msgbuf,i); 384 | return 1; 385 | } 386 | 387 | void printip(unsigned char * buffer) { 388 | printf("%d.%d.%d.%d", buffer[0],buffer[1],buffer[2],buffer[3]); 389 | } 390 | 391 | void dhcp_dump(unsigned char *buffer,int size) { 392 | int j; 393 | 394 | if (verbose == 0) 395 | return; 396 | 397 | // 398 | // Are you sure you want to see this? Try dhcpdump, which is better 399 | // suited for this kind of work... See http://www.mavetju.org 400 | // 401 | if (verbose > 2) { 402 | printf("packet %d bytes\n",size); 403 | for (j = 0; j < size; j++) { 404 | printf("%02x ",buffer[j]); 405 | if (j%16==15) printf(" (%2d)\n", j / 16); 406 | } 407 | printf("\n"); 408 | for (j = 0; j < size; j++) { 409 | if (isprint(buffer[j])) 410 | printf("%c ",buffer[j]); 411 | else 412 | printf(" "); 413 | if (j%16==15) printf(" (%2d)\n", j / 16); 414 | } 415 | printf("\n"); 416 | 417 | printf("op: %d\n",buffer[0]); 418 | printf("htype: %d\n",buffer[1]); 419 | printf("hlen: %d\n",buffer[2]); 420 | printf("hops: %d\n",buffer[3]); 421 | 422 | printf("xid: %02x%02x%02x%02x\n", 423 | buffer[4],buffer[5],buffer[6],buffer[7]); 424 | printf("secs: %d\n",255*buffer[8]+buffer[9]); 425 | printf("flags: %x\n",255*buffer[10]+buffer[11]); 426 | 427 | printf("ciaddr: %d.%d.%d.%d\n", 428 | buffer[12],buffer[13],buffer[14],buffer[15]); 429 | printf("yiaddr: %d.%d.%d.%d\n", 430 | buffer[16],buffer[17],buffer[18],buffer[19]); 431 | printf("siaddr: %d.%d.%d.%d\n", 432 | buffer[20],buffer[21],buffer[22],buffer[23]); 433 | printf("giaddr: %d.%d.%d.%d\n", 434 | buffer[24],buffer[25],buffer[26],buffer[27]); 435 | printf("chaddr: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", 436 | buffer[28],buffer[29],buffer[30],buffer[31], 437 | buffer[32],buffer[33],buffer[34],buffer[35], 438 | buffer[36],buffer[37],buffer[38],buffer[39], 439 | buffer[40],buffer[41],buffer[42],buffer[43]); 440 | printf("sname : %s.\n",buffer+44); 441 | printf("fname : %s.\n",buffer+108); 442 | } 443 | 444 | j=236; 445 | j+=4; /* cookie */ 446 | while (j - send a DHCP request to DHCP server to check its configuration 4 | 5 | =head1 SYNOPSIS 6 | 7 | B 8 | [B<-v>] [B<-q>] [B<-i>] [B<-r>] 9 | B<-t> I 10 | B<-c> I 11 | B<-s> I 12 | B<-h> I 13 | [B<-g> I] 14 | 15 | =head1 DESCRIPTION 16 | 17 | This command allows the system administrator to check if a remote 18 | DHCP server is still functioning. 19 | 20 | Options are: 21 | 22 | =over 23 | 24 | =item B<-v> 25 | 26 | Verbose, print more information. Apply multiple times to see DHCP configuration details, connecting progress and the package in hex format. 27 | 28 | =item B<-i> 29 | 30 | Use DHCPINFORM packets. 31 | 32 | =item B<-r> 33 | 34 | Use DHCPREQUEST packets (default behaviour). 35 | 36 | =item B<-q> 37 | 38 | Quiet, print nothing on the screen. 39 | 40 | =item B<-t> I 41 | 42 | Maximum time to wait for an answer from the server in seconds. 43 | Default is 3 seconds. 44 | 45 | =item B<-c> I 46 | 47 | Request this IP address. Note that this is also the IP address the 48 | answer will be sent to. 49 | 50 | =item B<-s> I 51 | 52 | Send the DHCP packet to this IP address. 53 | 54 | =item B<-h> I 55 | 56 | Use this hardware-address in the DHCP request. It can be up to 57 | sixteen octets seperated by colons (i.e. 01:02:03:04) 58 | 59 | =item B<-g> I 60 | 61 | Use this IP address for the gateway IP address in the DHCP packet. 62 | This option is currently broken. 63 | 64 | =back 65 | 66 | =head1 RETURN VALUES 67 | 68 | If everything goes okay, it returns 0. If there went something 69 | wrong, it returns 1. 70 | 71 | =head1 SETUP 72 | 73 | This program should be installed setuid root or ran by root only. 74 | See SECURITY for more information. 75 | 76 | On your DHCP server, add these lines to the dhcpd.conf: 77 | 78 | host { 79 | hardware ethernet ; 80 | fixed-address ; 81 | } 82 | 83 | Then try it: 84 | 85 | $ dhcprobe -c I \ 86 | -s I \ 87 | -h I 88 | 89 | It will either respond with "no answer" or "Got answer from: I" 91 | 92 | The DHCP server logfile will give: 93 | S 94 | S 95 | S 96 | 97 | Running in DHCPINFORM mode with B<-i>: 98 | 99 | If you see "DHCPINFORM from 192.168.1.1 via xl0: not authoritative 100 | for subnet 192.168.1.0", you should add the authoritative statement 101 | to the subnet, See dhcpd.conf(5) for details. 102 | 103 | When running in very verbose mode, B tries to dump all 104 | data of the send and received DHCP packets. It will first dump the 105 | packet in hex-format, then decodes the header and finally the 106 | options. 107 | 108 | =head1 HOW IT WORKS 109 | 110 | The client either sends a DHCPREQUEST or DHCPINFORM packet to the 111 | server and waits for an answer. Then, if a DHCPREQUEST was send, 112 | it will send a DHCPRELEASE back to the server. 113 | 114 | =head1 SECURITY 115 | 116 | This program is installed setuid root as it requires the privileges 117 | to bind itself to port 68 (bootpc). Root privileges are dropped as 118 | soon as the program has bound itself to that port. 119 | 120 | =head1 BUGS 121 | 122 | Currently (this may, or may not, change in the future) the ISC DHCP 123 | daemon does not write leases with a fixed IP address in the 124 | dhcpd.leases file. 125 | 126 | DHCPINFORM packets can only be used on subnets the server is authori- 127 | tative for. If the monitoring script runs on a subnet the server 128 | isn't authoritative for, it should use the DHCPREQUEST packets. I 129 | also experienced some problems with ISC DHCPD v2 servers, but that 130 | is also in the README of it. 131 | 132 | The B<-V> option is still working, but shouldn't be used for 133 | debugging of the packets. Better use dhcpdump(8) for that, which 134 | is available on my website. I wanted to remove it, but decided only 135 | to do it from the documentation, not from the code. Maybe I'll need 136 | it one day for debugging. 137 | 138 | =head1 AUTHOR 139 | 140 | Edwin Groothuis, edwin@mavetju.org (http://www.mavetju.org) 141 | Johannes Buchner, buchner.johannes@gmx.at (https://github.com/JohannesBuchner/DHCProbe) 142 | 143 | =head1 SEE ALSO 144 | 145 | dhcpd(8), dhclient(8), dhcpd.conf(5), dhcpdump(8) 146 | -------------------------------------------------------------------------------- /install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # install - install a program, script, or datafile 4 | # This comes from X11R5 (mit/util/scripts/install.sh). 5 | # 6 | # Copyright 1991 by the Massachusetts Institute of Technology 7 | # 8 | # Permission to use, copy, modify, distribute, and sell this software and its 9 | # documentation for any purpose is hereby granted without fee, provided that 10 | # the above copyright notice appear in all copies and that both that 11 | # copyright notice and this permission notice appear in supporting 12 | # documentation, and that the name of M.I.T. not be used in advertising or 13 | # publicity pertaining to distribution of the software without specific, 14 | # written prior permission. M.I.T. makes no representations about the 15 | # suitability of this software for any purpose. It is provided "as is" 16 | # without express or implied warranty. 17 | # 18 | # Calling this script install-sh is preferred over install.sh, to prevent 19 | # `make' implicit rules from creating a file called install from it 20 | # when there is no Makefile. 21 | # 22 | # This script is compatible with the BSD install script, but was written 23 | # from scratch. It can only install one file at a time, a restriction 24 | # shared with many OS's install programs. 25 | 26 | 27 | # set DOITPROG to echo to test this script 28 | 29 | # Don't use :- since 4.3BSD and earlier shells don't like it. 30 | doit="${DOITPROG-}" 31 | 32 | 33 | # put in absolute paths if you don't have them in your path; or use env. vars. 34 | 35 | mvprog="${MVPROG-mv}" 36 | cpprog="${CPPROG-cp}" 37 | chmodprog="${CHMODPROG-chmod}" 38 | chownprog="${CHOWNPROG-chown}" 39 | chgrpprog="${CHGRPPROG-chgrp}" 40 | stripprog="${STRIPPROG-strip}" 41 | rmprog="${RMPROG-rm}" 42 | mkdirprog="${MKDIRPROG-mkdir}" 43 | 44 | transformbasename="" 45 | transform_arg="" 46 | instcmd="$mvprog" 47 | chmodcmd="$chmodprog 0755" 48 | chowncmd="" 49 | chgrpcmd="" 50 | stripcmd="" 51 | rmcmd="$rmprog -f" 52 | mvcmd="$mvprog" 53 | src="" 54 | dst="" 55 | dir_arg="" 56 | 57 | while [ x"$1" != x ]; do 58 | case $1 in 59 | -c) instcmd="$cpprog" 60 | shift 61 | continue;; 62 | 63 | -d) dir_arg=true 64 | shift 65 | continue;; 66 | 67 | -m) chmodcmd="$chmodprog $2" 68 | shift 69 | shift 70 | continue;; 71 | 72 | -o) chowncmd="$chownprog $2" 73 | shift 74 | shift 75 | continue;; 76 | 77 | -g) chgrpcmd="$chgrpprog $2" 78 | shift 79 | shift 80 | continue;; 81 | 82 | -s) stripcmd="$stripprog" 83 | shift 84 | continue;; 85 | 86 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` 87 | shift 88 | continue;; 89 | 90 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` 91 | shift 92 | continue;; 93 | 94 | *) if [ x"$src" = x ] 95 | then 96 | src=$1 97 | else 98 | # this colon is to work around a 386BSD /bin/sh bug 99 | : 100 | dst=$1 101 | fi 102 | shift 103 | continue;; 104 | esac 105 | done 106 | 107 | if [ x"$src" = x ] 108 | then 109 | echo "install: no input file specified" 110 | exit 1 111 | else 112 | : 113 | fi 114 | 115 | if [ x"$dir_arg" != x ]; then 116 | dst=$src 117 | src="" 118 | 119 | if [ -d $dst ]; then 120 | instcmd=: 121 | chmodcmd="" 122 | else 123 | instcmd=$mkdirprog 124 | fi 125 | else 126 | 127 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 128 | # might cause directories to be created, which would be especially bad 129 | # if $src (and thus $dsttmp) contains '*'. 130 | 131 | if [ -f $src -o -d $src ] 132 | then 133 | : 134 | else 135 | echo "install: $src does not exist" 136 | exit 1 137 | fi 138 | 139 | if [ x"$dst" = x ] 140 | then 141 | echo "install: no destination specified" 142 | exit 1 143 | else 144 | : 145 | fi 146 | 147 | # If destination is a directory, append the input filename; if your system 148 | # does not like double slashes in filenames, you may need to add some logic 149 | 150 | if [ -d $dst ] 151 | then 152 | dst="$dst"/`basename $src` 153 | else 154 | : 155 | fi 156 | fi 157 | 158 | ## this sed command emulates the dirname command 159 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` 160 | 161 | # Make sure that the destination directory exists. 162 | # this part is taken from Noah Friedman's mkinstalldirs script 163 | 164 | # Skip lots of stat calls in the usual case. 165 | if [ ! -d "$dstdir" ]; then 166 | defaultIFS=' 167 | ' 168 | IFS="${IFS-${defaultIFS}}" 169 | 170 | oIFS="${IFS}" 171 | # Some sh's can't handle IFS=/ for some reason. 172 | IFS='%' 173 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` 174 | IFS="${oIFS}" 175 | 176 | pathcomp='' 177 | 178 | while [ $# -ne 0 ] ; do 179 | pathcomp="${pathcomp}${1}" 180 | shift 181 | 182 | if [ ! -d "${pathcomp}" ] ; 183 | then 184 | $mkdirprog "${pathcomp}" 185 | else 186 | : 187 | fi 188 | 189 | pathcomp="${pathcomp}/" 190 | done 191 | fi 192 | 193 | if [ x"$dir_arg" != x ] 194 | then 195 | $doit $instcmd $dst && 196 | 197 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && 198 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && 199 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && 200 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi 201 | else 202 | 203 | # If we're going to rename the final executable, determine the name now. 204 | 205 | if [ x"$transformarg" = x ] 206 | then 207 | dstfile=`basename $dst` 208 | else 209 | dstfile=`basename $dst $transformbasename | 210 | sed $transformarg`$transformbasename 211 | fi 212 | 213 | # don't allow the sed command to completely eliminate the filename 214 | 215 | if [ x"$dstfile" = x ] 216 | then 217 | dstfile=`basename $dst` 218 | else 219 | : 220 | fi 221 | 222 | # Make a temp file name in the proper directory. 223 | 224 | dsttmp=$dstdir/#inst.$$# 225 | 226 | # Move or copy the file name to the temp name 227 | 228 | $doit $instcmd $src $dsttmp && 229 | 230 | trap "rm -f ${dsttmp}" 0 && 231 | 232 | # and set any options; do chmod last to preserve setuid bits 233 | 234 | # If any of these fail, we abort the whole thing. If we want to 235 | # ignore errors from any of these, just make sure not to ignore 236 | # errors from the above "$doit $instcmd $src $dsttmp" command. 237 | 238 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && 239 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && 240 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && 241 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && 242 | 243 | # Now rename the file to the real destination. 244 | 245 | $doit $rmcmd -f $dstdir/$dstfile && 246 | $doit $mvcmd $dsttmp $dstdir/$dstfile 247 | 248 | fi && 249 | 250 | 251 | exit 0 252 | -------------------------------------------------------------------------------- /missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | # Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc. 4 | # Originally by Fran,cois Pinard , 1996. 5 | 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2, or (at your option) 9 | # any later version. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 19 | # 02111-1307, USA. 20 | 21 | # As a special exception to the GNU General Public License, if you 22 | # distribute this file as part of a program that contains a 23 | # configuration script generated by Autoconf, you may include it under 24 | # the same distribution terms that you use for the rest of that program. 25 | 26 | if test $# -eq 0; then 27 | echo 1>&2 "Try \`$0 --help' for more information" 28 | exit 1 29 | fi 30 | 31 | run=: 32 | 33 | # In the cases where this matters, `missing' is being run in the 34 | # srcdir already. 35 | if test -f configure.ac; then 36 | configure_ac=configure.ac 37 | else 38 | configure_ac=configure.in 39 | fi 40 | 41 | case "$1" in 42 | --run) 43 | # Try to run requested program, and just exit if it succeeds. 44 | run= 45 | shift 46 | "$@" && exit 0 47 | ;; 48 | esac 49 | 50 | # If it does not exist, or fails to run (possibly an outdated version), 51 | # try to emulate it. 52 | case "$1" in 53 | 54 | -h|--h|--he|--hel|--help) 55 | echo "\ 56 | $0 [OPTION]... PROGRAM [ARGUMENT]... 57 | 58 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 59 | error status if there is no known handling for PROGRAM. 60 | 61 | Options: 62 | -h, --help display this help and exit 63 | -v, --version output version information and exit 64 | --run try to run the given command, and emulate it if it fails 65 | 66 | Supported PROGRAM values: 67 | aclocal touch file \`aclocal.m4' 68 | autoconf touch file \`configure' 69 | autoheader touch file \`config.h.in' 70 | automake touch all \`Makefile.in' files 71 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 72 | flex create \`lex.yy.c', if possible, from existing .c 73 | help2man touch the output file 74 | lex create \`lex.yy.c', if possible, from existing .c 75 | makeinfo touch the output file 76 | tar try tar, gnutar, gtar, then tar without non-portable flags 77 | yacc create \`y.tab.[ch]', if possible, from existing .[ch]" 78 | ;; 79 | 80 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 81 | echo "missing 0.3 - GNU automake" 82 | ;; 83 | 84 | -*) 85 | echo 1>&2 "$0: Unknown \`$1' option" 86 | echo 1>&2 "Try \`$0 --help' for more information" 87 | exit 1 88 | ;; 89 | 90 | aclocal) 91 | echo 1>&2 "\ 92 | WARNING: \`$1' is missing on your system. You should only need it if 93 | you modified \`acinclude.m4' or \`${configure_ac}'. You might want 94 | to install the \`Automake' and \`Perl' packages. Grab them from 95 | any GNU archive site." 96 | touch aclocal.m4 97 | ;; 98 | 99 | autoconf) 100 | echo 1>&2 "\ 101 | WARNING: \`$1' is missing on your system. You should only need it if 102 | you modified \`${configure_ac}'. You might want to install the 103 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 104 | archive site." 105 | touch configure 106 | ;; 107 | 108 | autoheader) 109 | echo 1>&2 "\ 110 | WARNING: \`$1' is missing on your system. You should only need it if 111 | you modified \`acconfig.h' or \`${configure_ac}'. You might want 112 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 113 | from any GNU archive site." 114 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 115 | test -z "$files" && files="config.h" 116 | touch_files= 117 | for f in $files; do 118 | case "$f" in 119 | *:*) touch_files="$touch_files "`echo "$f" | 120 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 121 | *) touch_files="$touch_files $f.in";; 122 | esac 123 | done 124 | touch $touch_files 125 | ;; 126 | 127 | automake) 128 | echo 1>&2 "\ 129 | WARNING: \`$1' is missing on your system. You should only need it if 130 | you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 131 | You might want to install the \`Automake' and \`Perl' packages. 132 | Grab them from any GNU archive site." 133 | find . -type f -name Makefile.am -print | 134 | sed 's/\.am$/.in/' | 135 | while read f; do touch "$f"; done 136 | ;; 137 | 138 | bison|yacc) 139 | echo 1>&2 "\ 140 | WARNING: \`$1' is missing on your system. You should only need it if 141 | you modified a \`.y' file. You may need the \`Bison' package 142 | in order for those modifications to take effect. You can get 143 | \`Bison' from any GNU archive site." 144 | rm -f y.tab.c y.tab.h 145 | if [ $# -ne 1 ]; then 146 | eval LASTARG="\${$#}" 147 | case "$LASTARG" in 148 | *.y) 149 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 150 | if [ -f "$SRCFILE" ]; then 151 | cp "$SRCFILE" y.tab.c 152 | fi 153 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 154 | if [ -f "$SRCFILE" ]; then 155 | cp "$SRCFILE" y.tab.h 156 | fi 157 | ;; 158 | esac 159 | fi 160 | if [ ! -f y.tab.h ]; then 161 | echo >y.tab.h 162 | fi 163 | if [ ! -f y.tab.c ]; then 164 | echo 'main() { return 0; }' >y.tab.c 165 | fi 166 | ;; 167 | 168 | lex|flex) 169 | echo 1>&2 "\ 170 | WARNING: \`$1' is missing on your system. You should only need it if 171 | you modified a \`.l' file. You may need the \`Flex' package 172 | in order for those modifications to take effect. You can get 173 | \`Flex' from any GNU archive site." 174 | rm -f lex.yy.c 175 | if [ $# -ne 1 ]; then 176 | eval LASTARG="\${$#}" 177 | case "$LASTARG" in 178 | *.l) 179 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 180 | if [ -f "$SRCFILE" ]; then 181 | cp "$SRCFILE" lex.yy.c 182 | fi 183 | ;; 184 | esac 185 | fi 186 | if [ ! -f lex.yy.c ]; then 187 | echo 'main() { return 0; }' >lex.yy.c 188 | fi 189 | ;; 190 | 191 | help2man) 192 | echo 1>&2 "\ 193 | WARNING: \`$1' is missing on your system. You should only need it if 194 | you modified a dependency of a manual page. You may need the 195 | \`Help2man' package in order for those modifications to take 196 | effect. You can get \`Help2man' from any GNU archive site." 197 | 198 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 199 | if test -z "$file"; then 200 | file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` 201 | fi 202 | if [ -f "$file" ]; then 203 | touch $file 204 | else 205 | test -z "$file" || exec >$file 206 | echo ".ab help2man is required to generate this page" 207 | exit 1 208 | fi 209 | ;; 210 | 211 | makeinfo) 212 | if test -z "$run" && (makeinfo --version > /dev/null 2>&1); then 213 | # We have makeinfo, but it failed. 214 | exit 1 215 | fi 216 | 217 | echo 1>&2 "\ 218 | WARNING: \`$1' is missing on your system. You should only need it if 219 | you modified a \`.texi' or \`.texinfo' file, or any other file 220 | indirectly affecting the aspect of the manual. The spurious 221 | call might also be the consequence of using a buggy \`make' (AIX, 222 | DU, IRIX). You might want to install the \`Texinfo' package or 223 | the \`GNU make' package. Grab either from any GNU archive site." 224 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 225 | if test -z "$file"; then 226 | file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 227 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` 228 | fi 229 | touch $file 230 | ;; 231 | 232 | tar) 233 | shift 234 | if test -n "$run"; then 235 | echo 1>&2 "ERROR: \`tar' requires --run" 236 | exit 1 237 | fi 238 | 239 | # We have already tried tar in the generic part. 240 | # Look for gnutar/gtar before invocation to avoid ugly error 241 | # messages. 242 | if (gnutar --version > /dev/null 2>&1); then 243 | gnutar ${1+"$@"} && exit 0 244 | fi 245 | if (gtar --version > /dev/null 2>&1); then 246 | gtar ${1+"$@"} && exit 0 247 | fi 248 | firstarg="$1" 249 | if shift; then 250 | case "$firstarg" in 251 | *o*) 252 | firstarg=`echo "$firstarg" | sed s/o//` 253 | tar "$firstarg" ${1+"$@"} && exit 0 254 | ;; 255 | esac 256 | case "$firstarg" in 257 | *h*) 258 | firstarg=`echo "$firstarg" | sed s/h//` 259 | tar "$firstarg" ${1+"$@"} && exit 0 260 | ;; 261 | esac 262 | fi 263 | 264 | echo 1>&2 "\ 265 | WARNING: I can't seem to be able to run \`tar' with the given arguments. 266 | You may want to install GNU tar or Free paxutils, or check the 267 | command line arguments." 268 | exit 1 269 | ;; 270 | 271 | *) 272 | echo 1>&2 "\ 273 | WARNING: \`$1' is needed, and you do not seem to have it handy on your 274 | system. You might have modified some files without having the 275 | proper tools for further handling them. Check the \`README' file, 276 | it often tells you about the needed prerequirements for installing 277 | this package. You may also peek at any GNU archive site, in case 278 | some other package would contain this missing \`$1' program." 279 | exit 1 280 | ;; 281 | esac 282 | 283 | exit 0 284 | -------------------------------------------------------------------------------- /mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.1 2002/01/26 14:09:36 mavetju Exp $ 8 | 9 | errstatus=0 10 | dirmode="" 11 | 12 | usage="\ 13 | Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." 14 | 15 | # process command line arguments 16 | while test $# -gt 0 ; do 17 | case "${1}" in 18 | -h | --help | --h* ) # -h for help 19 | echo "${usage}" 1>&2; exit 0 ;; 20 | -m ) # -m PERM arg 21 | shift 22 | test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } 23 | dirmode="${1}" 24 | shift ;; 25 | -- ) shift; break ;; # stop option processing 26 | -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option 27 | * ) break ;; # first non-opt arg 28 | esac 29 | done 30 | 31 | for file 32 | do 33 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 34 | shift 35 | 36 | pathcomp= 37 | for d 38 | do 39 | pathcomp="$pathcomp$d" 40 | case "$pathcomp" in 41 | -* ) pathcomp=./$pathcomp ;; 42 | esac 43 | 44 | if test ! -d "$pathcomp"; then 45 | echo "mkdir $pathcomp" 46 | 47 | mkdir "$pathcomp" || lasterr=$? 48 | 49 | if test ! -d "$pathcomp"; then 50 | errstatus=$lasterr 51 | else 52 | if test ! -z "$dirmode"; then 53 | echo "chmod $dirmode $pathcomp" 54 | 55 | lasterr="" 56 | chmod $dirmode "$pathcomp" || lasterr=$? 57 | 58 | if test ! -z "$lasterr"; then 59 | errstatus=$lasterr 60 | fi 61 | fi 62 | fi 63 | fi 64 | 65 | pathcomp="$pathcomp/" 66 | done 67 | done 68 | 69 | exit $errstatus 70 | 71 | # Local Variables: 72 | # mode:shell-script 73 | # sh-indentation:3 74 | # End: 75 | --------------------------------------------------------------------------------