cdtool-2.1.8/0000755000000000000000000000000010466315462011513 5ustar rootrootcdtool-2.1.8/configure0000755000000000000000000053203710334464625013434 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for CDTOOL 2.1.8pre3. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='CDTOOL' PACKAGE_TARNAME='cdtool' PACKAGE_VERSION='2.1.8pre3' PACKAGE_STRING='CDTOOL 2.1.8pre3' PACKAGE_BUGREPORT='cdtool-devel@lists.hinterhof.net' # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S STRIP ac_ct_STRIP MYCFLAGS MYBUILDDATE LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures CDTOOL 2.1.8pre3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of CDTOOL 2.1.8pre3:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-scsi Disable SCSI code (default: no) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF CDTOOL configure 2.1.8pre3 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by CDTOOL $as_me 2.1.8pre3, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); int main () { connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 if test $ac_cv_lib_socket_connect = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in getopt.h mntent.h sys/mnttab.h ioctl.h sys/ioctl.h fcntl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------------------- ## ## Report this to cdtool-devel@lists.hinterhof.net ## ## ----------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/cdio.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------------------- ## ## Report this to cdtool-devel@lists.hinterhof.net ## ## ----------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF cdrom_header="sys/cdio.h" fi done for ac_header in linux/cdrom.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------------------- ## ## Report this to cdtool-devel@lists.hinterhof.net ## ## ----------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF cdrom_header="linux/cdrom.h" fi done if test -z "$cdrom_header"; then { { echo "$as_me:$LINENO: error: No cdrom header" >&5 echo "$as_me: error: No cdrom header" >&2;} { (exit 1); exit 1; }; } fi ioctl=CDROMRESET echo "$as_me:$LINENO: checking for ioctl $ioctl" >&5 echo $ECHO_N "checking for ioctl $ioctl... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$cdrom_header> #ifdef $ioctl have_$ioctl #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "have_$ioctl" >/dev/null 2>&1; then found=yes else found=no fi rm -f conftest* echo "$as_me:$LINENO: result: $found" >&5 echo "${ECHO_T}$found" >&6 if test "$found" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_IOCTL_$ioctl 1 _ACEOF fi ioctl=CDROMCLOSETRAY echo "$as_me:$LINENO: checking for ioctl $ioctl" >&5 echo $ECHO_N "checking for ioctl $ioctl... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$cdrom_header> #ifdef $ioctl have_$ioctl #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "have_$ioctl" >/dev/null 2>&1; then found=yes else found=no fi rm -f conftest* echo "$as_me:$LINENO: result: $found" >&5 echo "${ECHO_T}$found" >&6 if test "$found" = "yes"; then cat >>confdefs.h <<_ACEOF #define HAVE_IOCTL_$ioctl 1 _ACEOF fi echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5 echo $ECHO_N "checking type of array argument to getgroups... $ECHO_C" >&6 if test "${ac_cv_type_getgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_type_getgroups=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Mike Rendell for this test. */ #include #define NGID 256 #undef MAX #define MAX(x, y) ((x) > (y) ? (x) : (y)) int main () { gid_t gidset[NGID]; int i, n; union { gid_t gval; long lval; } val; val.lval = -1; for (i = 0; i < NGID; i++) gidset[i] = val.gval; n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, gidset); /* Exit non-zero if getgroups seems to require an array of ints. This happens when gid_t is short but getgroups modifies an array of ints. */ exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_getgroups=gid_t else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_type_getgroups=int fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_type_getgroups = cross; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then ac_cv_type_getgroups=gid_t else ac_cv_type_getgroups=int fi rm -f conftest* fi fi echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5 echo "${ECHO_T}$ac_cv_type_getgroups" >&6 cat >>confdefs.h <<_ACEOF #define GETGROUPS_T $ac_cv_type_getgroups _ACEOF echo "$as_me:$LINENO: checking for getgroups" >&5 echo $ECHO_N "checking for getgroups... $ECHO_C" >&6 if test "${ac_cv_func_getgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define getgroups to an innocuous variant, in case declares getgroups. For example, HP-UX 11i declares gettimeofday. */ #define getgroups innocuous_getgroups /* System header to define __stub macros and hopefully few prototypes, which can conflict with char getgroups (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef getgroups /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getgroups (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_getgroups) || defined (__stub___getgroups) choke me #else char (*f) () = getgroups; #endif #ifdef __cplusplus } #endif int main () { return f != getgroups; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_getgroups=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_getgroups=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_getgroups" >&5 echo "${ECHO_T}$ac_cv_func_getgroups" >&6 # If we don't yet have getgroups, see if it's in -lbsd. # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1. ac_save_LIBS=$LIBS if test $ac_cv_func_getgroups = no; then echo "$as_me:$LINENO: checking for getgroups in -lbsd" >&5 echo $ECHO_N "checking for getgroups in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_getgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getgroups (); int main () { getgroups (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_getgroups=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_getgroups=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_getgroups" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_getgroups" >&6 if test $ac_cv_lib_bsd_getgroups = yes; then GETGROUPS_LIB=-lbsd fi fi # Run the program to test the functionality of the system-supplied # getgroups function only if there is such a function. if test $ac_cv_func_getgroups = yes; then echo "$as_me:$LINENO: checking for working getgroups" >&5 echo $ECHO_N "checking for working getgroups... $ECHO_C" >&6 if test "${ac_cv_func_getgroups_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_getgroups_works=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* On Ultrix 4.3, getgroups (0, 0) always fails. */ exit (getgroups (0, 0) == -1 ? 1 : 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_getgroups_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_getgroups_works=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_getgroups_works" >&5 echo "${ECHO_T}$ac_cv_func_getgroups_works" >&6 if test $ac_cv_func_getgroups_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETGROUPS 1 _ACEOF fi fi LIBS=$ac_save_LIBS # getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware. echo "$as_me:$LINENO: checking for getmntent in -lsun" >&5 echo $ECHO_N "checking for getmntent in -lsun... $ECHO_C" >&6 if test "${ac_cv_lib_sun_getmntent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsun $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getmntent (); int main () { getmntent (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_sun_getmntent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sun_getmntent=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getmntent" >&5 echo "${ECHO_T}$ac_cv_lib_sun_getmntent" >&6 if test $ac_cv_lib_sun_getmntent = yes; then LIBS="-lsun $LIBS" else echo "$as_me:$LINENO: checking for getmntent in -lseq" >&5 echo $ECHO_N "checking for getmntent in -lseq... $ECHO_C" >&6 if test "${ac_cv_lib_seq_getmntent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lseq $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getmntent (); int main () { getmntent (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_seq_getmntent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_seq_getmntent=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getmntent" >&5 echo "${ECHO_T}$ac_cv_lib_seq_getmntent" >&6 if test $ac_cv_lib_seq_getmntent = yes; then LIBS="-lseq $LIBS" else echo "$as_me:$LINENO: checking for getmntent in -lgen" >&5 echo $ECHO_N "checking for getmntent in -lgen... $ECHO_C" >&6 if test "${ac_cv_lib_gen_getmntent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgen $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getmntent (); int main () { getmntent (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gen_getmntent=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_gen_getmntent=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_gen_getmntent" >&5 echo "${ECHO_T}$ac_cv_lib_gen_getmntent" >&6 if test $ac_cv_lib_gen_getmntent = yes; then LIBS="-lgen $LIBS" fi fi fi for ac_func in getmntent do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strsep memmove memset socket gethostbyname do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6 if test "${ac_cv_search_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_gethostbyname=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_gethostbyname="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_gethostbyname" = no; then for ac_lib in nsl; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_gethostbyname="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6 if test "$ac_cv_search_gethostbyname" != no; then test "$ac_cv_search_gethostbyname" = "none required" || LIBS="$ac_cv_search_gethostbyname $LIBS" fi echo "$as_me:$LINENO: checking whether to disable SCSI code" >&5 echo $ECHO_N "checking whether to disable SCSI code... $ECHO_C" >&6 # Check whether --enable-scsi or --disable-scsi was given. if test "${enable_scsi+set}" = set; then enableval="$enable_scsi" disable_scsi=yes else disable_scsi=no fi; echo "$as_me:$LINENO: result: $disable_scsi" >&5 echo "${ECHO_T}$disable_scsi" >&6 if test "$disable_scsi" = "yes"; then MYCFLAGS="${MYCFLAGS} -DNOSCSI" fi if test "$GCC" = yes; then MYCFLAGS="${MYCFLAGS} ${CFLAGS} -Wall" fi MYBUILDDATE=`date +%Y%m%d` ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by CDTOOL $as_me 2.1.8pre3, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ CDTOOL config.status 2.1.8pre3 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LN_S@,$LN_S,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@MYCFLAGS@,$MYCFLAGS,;t t s,@MYBUILDDATE@,$MYBUILDDATE,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi cdtool-2.1.8/cdloop0000755000000000000000000000262010102210665012703 0ustar rootroot#!/bin/sh # # Module: cdloop # Purpose: to restart a CD when it ceases playing # Author: M. M. Eccles # Date: 30 December 1997 # # Notes: If argument v is specified, writes messages to standard out # when status is checked. # # Changes: # Remove logfile, default to empty $DEV for automatic detection. # # RCS: # $Log: cdloop,v $ # Revision 1.2 1998/01/06 21:00:33 wadeh # Added DoCr, changes to fix cdeject crash. # # Revision 1.1 1997/12/30 23:04:10 wadeh # Initial revision # # Notes: # 1) This program uses cdloop and cdplay.... # 2) By default, this uses the default CDROM compiled in cdtools # 3) Usage: # cdloop -- loop default CDROM # cdloop v -- verbose operation # cdloop 1 -- use second CDROM # cdloop v 1 -- verbose, use second CDROM # INT=60 DONE=0 DEV= # fail on errors set -e #assumes cd is already opened if [ "$1" = "1" ] then DEV=-1 echo using drive 1 fi if [ "$2" = "1" ] then DEV=-1 echo using drive 1 fi until [ "$DONE" -eq 1 ] do STATUS=`cdinfo $DEV` if [ "$1" = "v" ] then echo Status is "$STATUS" fi if [ "$1" = "v" ] then NOW=`date +"%m/%d/%y %H:%M:%S"` fi if [ "$STATUS" = "play " ] then if [ "$1" = "v" ] then echo "$NOW Already playing..." fi else if [ "$1" = "v" ] then echo "$NOW: Starting play...." fi cdplay $DEV 1 fi sleep $INT done cdtool-2.1.8/cdtool2cddb.c0000644000000000000000000002100610324773577014051 0ustar rootroot/* * cdtooldb2cddb.c * convert .cdtooldb to cddb files * Copyright (C) 2000 Peter Samuelson * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * v0.1 10 Dec 2000 initial public release */ #include "config.h" #include #include #include #include #include #include #include #ifdef HAVE_GETOPT # include #endif #define PROGNAME "cdtool2cddb" #define PROGVERSION "0.1" #define MAXTRKLEN 1024 #define MAXTRACKS 256 struct cdbuf { unsigned int id; int length, tracks; int offset[MAXTRACKS+1]; char title[MAXTRKLEN]; char artist[MAXTRKLEN]; char track[MAXTRACKS][MAXTRKLEN]; }; /********** options **********/ char *report_submitter = PROGNAME " " PROGVERSION; /* tell the truth... */ #define VERSION_CDDB "xmcd 2.6 PL0" /* lie */ #define OUTFILE_FORMAT "%s/%08x" /* for xmcd, groovycd */ char *crlf = "\n"; /* groovycd seems to prefer "\r\n" */ char *outdir = "."; /* output directory */ int cddb_max_line = 76; /* the official limit (?) */ int verbose = 0; /* chompsp: inspired by Perl chomp. Kills all trailing space. */ static void chompsp (char *str) { int l = strlen (str) - 1; while (l >= 0 && isspace (str[l])) l--; str[l+1] = '\0'; } /* * parse .cdtooldb entry into struct cdbuf * This does not calculate the checksum because I figured that * is more "processing" than "input" * return 0 on EOF or parse error, 1 if successful */ int read_cdtooldb(FILE *in, struct cdbuf *b) { int i, trk = 0; static char buf[1024]; memset (b, 0, sizeof (*b)); if (!buf[0]) fgets (buf, 1024, in); while (1) { if (!buf[0] || isspace(buf[0])) { if (b->tracks || feof (in)) break; } else if (!strncmp (buf, "tracks ", 7)) { char *p = buf+7; if (b->tracks) break; while (*p && isspace(*p)) p++; b->tracks = atoi (p); if (b->tracks <= 0 || b->tracks > MAXTRACKS) return 0; for (i=0; i<=b->tracks; i++) { /* fencepost, but on purpose */ while (*p && !isspace(*p)) p++; while (*p && isspace(*p)) p++; if (!*p) /* not enough space-separated numbers */ return 0; b->offset[i] = atoi (p); if (b->offset[i] <= 0) return 0; } b->length = b->offset[--i]; b->offset[i] = 0; } else if (!strncmp (buf, "cdname ", 7)) { chompsp (buf+7); if (MAXTRKLEN < strlen(b->title) + strlen(buf+7) + 1) return 0; strcat (b->title, buf+7); } else if (!strncmp (buf, "artist ", 7)) { chompsp (buf+7); if (MAXTRKLEN < strlen(b->artist) + strlen(buf+7) + 1) return 0; strcat (b->artist, buf+7); } else if (!strncmp (buf, "track ", 6)) { if (trk == b->tracks) /* too many track labels */ return 0; chompsp (buf+6); strncpy (b->track[trk], buf+6, MAXTRKLEN-1); b->track[trk++][MAXTRKLEN-1] = 0; } else return 0; buf[0] = 0; fgets (buf, 1024, in); } if (!b->tracks || !b->offset[b->tracks-1] || !b->length) return 0; return 1; } /* * Output a string, with a given prefix, with a given max line length * repeat the prefix at the beginning of each line * Needed for proper line wrap in put_cddb(). */ static void fputstring (FILE *f, int linelen, char *prefix, char *fmt, ...) { char buf[1024]; int buflen, perline, l = 0; va_list ap; va_start (ap, fmt); buflen = vsnprintf (buf, sizeof(buf)-1, fmt, ap); va_end (ap); if (buflen > sizeof(buf)-1) fprintf(stderr, "warning: truncated fputstring\n"); buf[sizeof(buf)-1] = 0; buflen = strlen(buf); perline = linelen - strlen (prefix); for (l=0; l < buflen; l += perline) { char *outbuf = malloc(strlen(prefix) + perline + 1); strcpy (outbuf, prefix); strncat (outbuf, buf+l, perline); outbuf[linelen] = 0; fprintf (f, "%s%s", outbuf, crlf); free(outbuf); } } /* * put_cddb: output the struct cdbuf in CDDB format * return value currently ignored */ int put_cddb (FILE *out, struct cdbuf *b) { int i; fprintf (out, "# xmcd CD database file%s" "#%s" "# Track frame offsets:%s", crlf, crlf, crlf); for (i=0; itracks; i++) fprintf (out, "#\t%d%s", b->offset[i], crlf); fprintf (out, "#%s" "# Disc length: %d seconds%s" "#%s" "# Revision: 1%s" "# Submitted via: %s%s" "#%s" "DISCID=%08x%s", crlf, b->length, crlf, crlf, crlf, report_submitter, crlf, crlf, b->id, crlf); fputstring (out, cddb_max_line, "DTITLE=", "%s / %s", b->artist, b->title); for (i=0; itracks; i++) { char label[12]; sprintf (label, "TTITLE%d=", i); fputstring (out, cddb_max_line, label, "%s", b->track[i]); } fprintf (out, "EXTD=%s", crlf); for (i=0; itracks; i++) fprintf (out, "EXTT%d=%s", i, crlf); fprintf (out, "PLAYORDER=%s", crlf); return 1; } /* * CDDB checksum. Algorithm learned from cdown.c by Byron Ellacott, * who claims to have gotten docs and code at http://www.cddb.com/. * * These days cddb.com do not allow anonymous access to docs, and I * am not willing to "register" for them, therefore we do not support * the all-singing, all-dancing "CDDB v2". Only the clumsy old v1. */ #define TICKS_PER_SEC 75 void calc_cddb (struct cdbuf *b) { /* b->length is in seconds, b->offset[] are in ticks */ int i, sum = 0, sum2 = b->length - b->offset[0]/TICKS_PER_SEC; for (i=0; i < b->tracks; i++) { int n = b->offset[i]/TICKS_PER_SEC; while (n) { sum += (n % 10); n /= 10; } } b->id = ((sum % 0xff) << 24) | (sum2 << 8) | b->tracks; } void do_help (int bad_bad_user, FILE *out) { fprintf (out, "Usage: " PROGNAME " [-rvx] [-d dir] [-l len] [input]\n"); if (bad_bad_user) { fprintf (out, " '" PROGNAME " -h' for help.\n"); exit (1); } fprintf (out, " -d dir set output directory (default: current directory)\n" " -l len set maximum length for CDDB data line (default: %d)\n" " -r output MS-DOS line endings (works around a bug in groovycd)\n" " -v verbose\n" " -x use 'xmcd' submitter string, so cddb.com will accept upload\n" " input input file in .cdtooldb format (default: stdin)\n", cddb_max_line); exit (0); } int main(int argc, char *argv[]) { struct cdbuf cdb; int c; FILE *fin, *fout; argv[0] = PROGNAME; /* for getopt */ while ((c = getopt (argc, argv, "hd:l:rvx")) > -1) { switch (c) { case 'h': do_help (0, stdout); break; case 'd': outdir = optarg; break; case 'l': cddb_max_line = atoi (optarg); if (!cddb_max_line) do_help (1, stderr); break; case 'r': crlf = "\r\n"; break; case 'v': verbose++; break; case 'x': report_submitter = VERSION_CDDB; /* Heh. */ break; default: do_help (1, stderr); } } fin = stdin; do { if (optind < argc) { fin = fopen (argv[optind], "r"); if (!fin) { fprintf (stderr, "Cannot open %s for reading: %s\n", argv[optind], strerror(errno)); exit (1); } if (verbose > 1) fprintf (stderr, "Reading %s...\n", argv[optind]); optind++; } else if (verbose > 1) fprintf (stderr, "Reading standard input...\n"); while (read_cdtooldb (fin, &cdb)) { char *outfile; calc_cddb (&cdb); if (verbose) fprintf (stderr, "%08x: %s / %s\n", cdb.id, cdb.artist, cdb.title); outfile = malloc(strlen(outdir) + 1 + 16 + 1); sprintf (outfile, OUTFILE_FORMAT, outdir, cdb.id); fout = fopen (outfile, "w"); if (!fout) { fprintf (stderr, "Cannot open %s for writing: %s", outfile, strerror(errno)); free(outfile); continue; } put_cddb (fout, &cdb); if (verbose > 1) fprintf (stderr, "%08x: output to %s\n", cdb.id, outfile); fclose (fout); free(outfile); } fclose (fin); } while (optind < argc); return 0; } cdtool-2.1.8/commands.c0000644000000000000000000002545710334465024013467 0ustar rootroot/* commands.c * * Copyright 1994 thomas insel * Copyright 1995 sven oliver moll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 dated June, 1991. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include #include #include #include "config.h" #include "cdtool.h" #include "commands.h" #include "hardware.h" #include "shuffle.h" #include "util.h" #include "info.h" /************************************************************************ * Procedure: cdtool_open * Purpose: finds device, opens it, allocates and reads *hw. * Returns: * -1 failure * 0 success ************************************************************************/ int cdtool_open(cdtool_t *cdtool, char *device) { int fd; char *cddev; cdhw_t *hw; /* tries detection if device is NULL */ if ((cddev = device_detect(device)) == NULL) { if (!device) errormsg("%P: no cdrom found: Try option -d "); return(-1); } if ((fd = open(cddev, O_RDONLY | O_NONBLOCK)) < 0) { errormsg("%P: can't open cdrom (%s): %s", cddev, strerror(errno)); if (errno == EACCES) show_permissions(cddev); return(-1); } hw = read_hw(fd); if (!hw) return(-1); cdtool->fd = fd; cdtool->device = cddev; cdtool->hw = hw; return(0); } /************************************************************************/ /* Procedure: do_play * Purpose: to start playing * Inputs: CD file descriptor, initial track, last track * Returns: 0< on error; 0 on success * ************************************************************************/ int do_play(cdtool_t *cd, int trk0, int trk1) { int newlast; struct cdrom_ti ti; cdhw_t *hw = cd->hw; debugmsg("do_play: called, trk0=%d, trk1=%d", trk0, trk1); if (!check_disc(hw)) { errormsg("%P: can't play (%s)", cd_status_text(hw->iStatus)); return(-1); } /* special cases for track "any" */ if ((trk0 == 0) && (trk1 == 0)) { debugmsg("do_play: trk[0.1]==0, status=%#x", hw->subchnl.cdsc_audiostatus); /* subchannel status returns PLAY, PAUSED, COMPLETED, or none */ switch (hw->subchnl.cdsc_audiostatus) { case CDROM_AUDIO_PAUSED: if (ioctl(cd->fd, CDROMRESUME) == -1) { errormsg("%P: ioctl cdromresume: %s", strerror(errno)); return(-1); } return(0); case CDROM_AUDIO_PLAY: trk0 = hw->subchnl.cdsc_trk; break; case CDROM_AUDIO_COMPLETED: /* WWH added */ trk0 = 1; break; case CDROM_AUDIO_NO_STATUS: /* ignore */ debugmsg("%P: ioctl subchnl: NO_STATUS"); break; case CDROM_AUDIO_INVALID: /* ignore */ debugmsg("%P: ioctl subchnl: INVALID"); break; case CDROM_AUDIO_ERROR: errormsg("%P: ioctl subchnl: ERROR"); return(-1); default: errormsg("%P: ioctl subchnl: unknown status: subchnl=%#x", hw->subchnl.cdsc_audiostatus); return(-1); } } /* default to TOC start/end tracks */ ti.cdti_trk0 = trk0 > 0 ? trk0 : hw->tochdr.cdth_trk0; ti.cdti_trk1 = trk1 > 0 ? trk1 : hw->tochdr.cdth_trk1; /* set track indices (XX what for?) */ ti.cdti_ind0 = 1; ti.cdti_ind1 = 99; /* XXXX */ if (ti.cdti_trk0 < first_track(hw)) ti.cdti_trk0 = first_track(hw); /* XXX */ if (ti.cdti_trk1 > last_track(hw)) ti.cdti_trk1 = last_track(hw); /* check range for non-audio tracks */ newlast = check_audio_range(hw, ti.cdti_trk0, ti.cdti_trk1); if (newlast < 0) { errormsg("%P: no audio tracks within requested range"); return(-1); } /* range may include data tracks; play up to last audio track */ if (newlast < ti.cdti_trk1) ti.cdti_trk1 = newlast; verbosemsg("Playing from track %d to %d", ti.cdti_trk0, ti.cdti_trk1); return do_play_ti(cd->fd, cd->hw, &ti); } /************************************************************************/ /* Procedure: do_skip * Purpose: skip forwards or backwards and (re-)start playing * Returns: 0< on error; 0 on success * * if direction is -1, skip back * if direction is -2, skip forward * ************************************************************************/ int do_skip(cdtool_t *cd, int direction, int skip) { cdhw_t *hw = cd->hw; int track = 0; if (!check_disc(hw)) { errormsg("%P: can't skip (%s)", cd_status_text(hw->iStatus)); return(-1); } if (skip < 1) skip = 1; /* skip back/forward from current track */ switch (direction) { case SKIPBACK: track = hw->subchnl.cdsc_trk - skip; break; case SKIPFORWARD: track = hw->subchnl.cdsc_trk + skip; } /* check against TOC range */ if ((track < hw->tochdr.cdth_trk0) || (track > hw->tochdr.cdth_trk1)) track = 1; /* play from 'track' to last track */ return do_play(cd, track, hw->tochdr.cdth_trk1); } /************************************************************************/ /* Procedure: do_pause * Purpose: to pause CD-ROM * * Inputs: program name, CD file des. * Outputs: to CD-ROM, debug output * Returns: 0< on error; 0 on success * Notes: * 1. */ /************************************************************************/ int do_pause(cdtool_t *cd) { cdhw_t *hw = cd->hw; verbosemsg("Pausing"); /* pause only if disc inserted */ if (!check_disc(hw)) { errormsg("%P: can't pause (%s)", cd_status_text(hw->iStatus)); return(-1); } debugmsg("do_pause: iStatus=%d subchnl_status=%d", hw->iStatus, hw->subchnl.cdsc_audiostatus); /* pause only if currently playing */ if (hw->subchnl.cdsc_audiostatus != CDROM_AUDIO_PLAY) { debugmsg("do_pause: not pausing: status != play"); return(0); } if (ioctl(cd->fd, CDROMPAUSE) == -1) { errormsg("%P: ioctl cdrompause: %s", strerror(errno)); return(-1); } return(0); } /************************************************************************/ /* Procedure: do_stop * Purpose: to stop playing a CD-ROM * * Inputs: program name, CD file des. * Outputs: to CD-ROM, debug output * Returns: 0< on error; 0 on success * Notes: * 1. */ /************************************************************************/ int do_stop(cdtool_t *cd, int iCDNum) { debugmsg("do_stop: called, cdfd=%d", cd->fd); verbosemsg("Stopping"); /* if shuffle is running, stop it... */ shuffle_unlock(iCDNum, 1); /* send stop to the CDROM device */ if (ioctl(cd->fd, CDROMSTOP) == -1) { errormsg("%P: ioctl cdromstop: %s", strerror(errno)); return(-1); } return(0); } /************************************************************************/ /* Procedure: do_eject * Purpose: to eject the CD-ROM * * Inputs: program name, CD file des. * Outputs: to CD-ROM, debug output * Returns: 0< on error; 0 on success * Notes: * 1. */ /************************************************************************/ int do_eject(cdtool_t *cd) { debugmsg("do_eject: called, cdfd=%d", cd->fd); verbosemsg("Ejecting CD-ROM"); if (ioctl(cd->fd, CDROMEJECT) == -1) { errormsg("%P: ioctl cdromeject: %s", strerror(errno)); return(-1); } return(0); } /************************************************************************/ /* Procedure: do_close * Purpose: to close the CD-ROM * * Inputs: program name, CD file des. * Outputs: to CD-ROM, debug output * Returns: 0< on error; 0 on success * Notes: * 1. */ /************************************************************************/ int do_close(cdtool_t *cd) { debugmsg("do_close: called, cdfd=%d", cd->fd); verbosemsg("Closing CD-ROM tray\n"); #ifdef HAVE_IOCTL_CDROMCLOSETRAY if (ioctl(cd->fd, CDROMCLOSETRAY) == -1) { errormsg("%P: ioctl cdromclose: %s", strerror(errno)); return(-1); } #endif return(0); } /************************************************************************/ /* Procedure: do_reset * Purpose: to reset the CD-ROM * * Inputs: program name, CD file des. * Outputs: to CD-ROM, debug output * Returns: n/a * Notes: * 1. */ /************************************************************************/ int do_reset(cdtool_t *cd) { debugmsg("do_reset: called, cdfd=%d", cd->fd); verbosemsg("Reseting CDROM\n"); #ifdef HAVE_IOCTL_CDROMRESET if (ioctl(cd->fd, CDROMRESET) == -1) { errormsg("%P: ioctl cdromreset: %s", strerror(errno)); return(-1); } #else /* Solaris doesn't know CDROMRESET */ if (ioctl(cd->fd, CDROMSTOP) == -1) { errormsg("%P: ioctl cdromstop: %s", strerror(errno)); return(-1); } #endif if (ioctl(cd->fd, CDROMSTART) == -1) { errormsg("%P: ioctl cdromstart: %s", strerror(errno)); return(-1); } return(0); } /************************************************************************/ /* Procedure: do_volume * Purpose: to adjust CD-ROM volume level * * Inputs: program name, CD file des., volume level (uchar) * Outputs: to CD-ROM, to stdout * Returns: 0 on success, -1 on failure * Notes: * 1. */ /************************************************************************/ int do_volume(cdtool_t *cd, int level) { struct cdrom_volctrl volctrl; debugmsg("do_volume: called, volume=%d, cdfd=%d", level, cd->fd); if ((level < 0) || (level > 255)) { errormsg("%P: illegal volume (allowed values 0-255)"); return -1; } verbosemsg("Setting volume to level %d", level); volctrl.channel0=level; volctrl.channel1=level; volctrl.channel2=level; volctrl.channel3=level; if (ioctl(cd->fd, CDROMVOLCTRL, &volctrl) == -1) { errormsg("%P: CDROMVOLCTRL ioctl failed: %s\n", strerror(errno)); return -1; } return 0; } cdtool-2.1.8/Makefile.in0000644000000000000000000000451410275455223013562 0ustar rootroot# Makefile for cdtool # 2004, Max Vozeler prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ includedir = @includedir@ libdir = @libdir@ PACKAGE = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ CC = @CC@ INSTALL = @INSTALL@ STRIP = @STRIP@ CFLAGS = @MYCFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ DESTDIR = PROGRAMS = cdown cdtool cdctrl cdtool2cddb OBJECTS = commands.o hardware.o database.o info.o shuffle.o util.o build: $(PROGRAMS) debug: CFLAGS += -DDEBUG -O0 debug: STRIP = debug: build cdtool: $(OBJECTS) cdtool.o $(CC) -o $@ $(LDFLAGS) $(OBJECTS) cdtool.o $(LIBS) cdctrl: $(OBJECTS) cdctrl.o $(CC) -o $@ $(LDFLAGS) $(OBJECTS) cdctrl.o $(LIBS) cdown: $(OBJECTS) cdown.o $(CC) -o $@ $(LDFLAGS) $(OBJECTS) cdown.o $(LIBS) cdtool2cddb: cdtool2cddb.o $(CC) -o $@ $(LDFLAGS) $(LIBS) $< install: install-files install-links install-files: mkdir -p $(DESTDIR)$(bindir) $(INSTALL) cdctrl $(DESTDIR)$(bindir) -o root $(INSTALL) cdloop $(DESTDIR)$(bindir) -o root $(INSTALL) cdadd $(DESTDIR)$(bindir) -o root $(INSTALL) cdown $(DESTDIR)$(bindir) -o root $(INSTALL) cdtool2cddb $(DESTDIR)$(bindir) -o root mkdir -p $(DESTDIR)$(mandir)/man1 $(INSTALL) cdctrl.1 $(DESTDIR)$(mandir)/man1 $(INSTALL) cdloop.1 $(DESTDIR)$(mandir)/man1 $(INSTALL) cdadd.1 $(DESTDIR)$(mandir)/man1 $(INSTALL) cdown.1 $(DESTDIR)$(mandir)/man1 $(INSTALL) cdtool.1 $(DESTDIR)$(mandir)/man1 $(INSTALL) cdtool2cddb.1 $(DESTDIR)$(mandir)/man1 mkdir -p $(DESTDIR)$(libdir)/cdtool $(INSTALL) cdtool $(DESTDIR)$(libdir)/cdtool -o root LINKTARGET = ../lib/cdtool/cdtool LINKS = cdplay cdpause cdstop cdclose cdeject cdir cdinfo cdreset \ cdvolume cdshuffle install-links-local: LINKTARGET = cdtool install-links-local: bindir = . install-links-local: install-links install-links: for command in $(LINKS); do \ if ! test -h $(DESTDIR)$(bindir)/$$command; then \ echo installing $$command; \ rm -f $(DESTDIR)$(bindir)/$$command; \ ln -s $(LINKTARGET) $(DESTDIR)$(bindir)/$$command; \ fi; \ if ! test -h $(DESTDIR)$(mandir)/man1/$$command.1; then \ echo installing $$command.1; \ rm -f $(DESTDIR)$(mandir)/man1/$$command.1; \ ln -s cdtool.1 $(DESTDIR)$(mandir)/man1/$$command.1; \ fi; \ done clean: rm -f *.o $(PROGRAMS) distclean: clean -rm -f config.cache config.log config.status cdtool-2.1.8/shuffle.h0000644000000000000000000000061110222275156013311 0ustar rootroot#ifndef __SHUFFLE_H__ #define __SHUFFLE_H__ #define PID_FILE "/.cdshuffle_" /* add number 0..9 */ void do_shuffle( cdtool_t *cdt, /* cdtool handle */ int iCDNum, /* CDROM device 0..9 */ int iTracks, /* max number tracks to play */ int iCount /* times to repeat play this CD */ ); int shuffle_lock(int cdnum); int shuffle_unlock(int cdnum, int stop); #endif cdtool-2.1.8/hardware.h0000644000000000000000000000304710275457316013470 0ustar rootroot/* hardware.h */ #ifndef __HARDWARE_H__ #define __HARDWARE_H__ #include "config.h" #ifdef HAVE_IOCTL_H # include #elif defined HAVE_SYS_IOCTL_H # include #else # error found no ioctl.h #endif #ifdef HAVE_LINUX_CDROM_H # include #elif defined HAVE_SYS_CDIO_H # include #else # error found no cdrom.h or cdio.h #endif /* additional error codes, see linux/cdrom.h */ #define NO_CDROM 200 #define CDROM_MOUNTED 201 #define CDROM_DATA_DISC 202 /* return codes from cd_status, these are derived from XPlaycd code */ #define CD_STATUS_ERROR -1 #define CD_STATUS_NO_CD 0 #define CD_STATUS_CD_IN 1 #define CD_STATUS_INSERTED 2 #define CD_STATUS_REMOVED 3 #define CD_STATUS_MOUNTED 4 #define CD_STATUS_DATA_DISC 5 #define MAX_TRACKS 99 /* state of the CD-ROM hardware */ typedef struct { int iStatus; /* see CD_STATUS* below */ int iData; int iAudio; struct cdrom_tochdr tochdr; /* from CDROMREADTOCHDR */ struct cdrom_tocentry tocentries[100]; /* from CDROMREADTOCENTRY */ struct cdrom_subchnl subchnl; /* from CDROMSUBCHNL */ } cdhw_t; /* procedures */ cdhw_t *read_hw(int fd); int update_hw(cdhw_t *hw, int fd); int check_audio_range(cdhw_t *hw, int trk0, int trk1); int first_track(const cdhw_t *hw); int last_track(const cdhw_t *hw); int is_audio_track(const cdhw_t *hw, int track); int check_disc(cdhw_t *hw); char *cd_status_text (int iStatus); int do_play_ti(int fd, cdhw_t *hw, struct cdrom_ti *ti); #endif cdtool-2.1.8/commands.h0000644000000000000000000000303010222352033013442 0ustar rootroot#ifndef __COMMANDS_H__ #define __COMMANDS_H__ #include "cdtool.h" #include "hardware.h" /************************************************************************/ /* * Header: commands.h * Purpose: to define commandd functions * Language/Compiler/O/S: GCC 2.7.2 * Author: Wade Hampton * Date: 12/23/97 * Revision History: * [from RCS] * * $Log: commands.h,v $ * Revision 1.1 1997/12/24 15:43:46 wadeh * Initial revision * * * Notes: * 1) *----------------------------------------------------------------------*/ /* TYPES- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* INCLUDE FILES- - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* CONSTANTS- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* LOCAL DATA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* EXTERNAL PROCEDURES- - - - - - - - - - - - - - - - - - - - - - - - - */ /* EXTERNAL DATA- - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* PROTOTYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ int cdtool_open(cdtool_t *cdtool, char *device); int do_play(cdtool_t *cdt, int trk0, int trk1); int do_skip(cdtool_t *cdt, int direction, int skip); int do_pause(cdtool_t *cdt); int do_stop(cdtool_t *cdt, int iCDNum); int do_eject(cdtool_t *cdt); int do_close(cdtool_t *cdt); int do_reset(cdtool_t *cdt); int do_volume(cdtool_t *cdt, int volume); /* * Copyright (C) 1997, 1998 Wade Hampton */ /************************************************************************/ #endif cdtool-2.1.8/config.guess0000755000000000000000000012475310320237042014031 0ustar rootroot#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-08-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: cdtool-2.1.8/cdown.c0000644000000000000000000005725210324773577013014 0ustar rootroot/* cdown.c version 0.6 * * utility to contact a CDDB server and download information about the * currently loaded CD in a format suitable for use with the cdtools * package, and specifically cdir. * * Copyright (C) 1998 Byron Ellacott * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Any modifications in distributed source should be clearly stated * immediately following this comment block. * */ /* CHANGELOG * * 0.6 Modifications by Max Vozeler * Relicensed under the GNU GPL with Byron's permission. * * Subject: Re: cdown.c * From: Byron Ellacott * To: Max Vozeler * Date: Mon, 11 Oct 2004 08:42:26 +1000 * Message-ID: <4169BAD2.8010307@apnic.net> * * Max Vozeler wrote: * >This is probably tangential to the above question, but I was wondering * >if you would consider to relicense cdown.c under the GPL, as that would * >make modifications of cdown and inclusion in other software * >"unambiguously" OK. * * Absolutely. Please feel free to alter the source to place it under the * terms of the GPL. The intent of the original license was never to * prevent distribution or modification, so I see no reason not to loosen * the restrictions on those activities. * * 0.5 Modifications by Peter Samuelson * Added -r option for raw CDDB output * * 0.4 Modifications by Max Vozeler * Further adapted to CDTOOL: Include config.h * and use device detection code and constants * from util.h * * 0.3 Modifications by Max Vozeler * Replace vasprintf() with vsnprintf() * Minor fixes * * 0.2 Modifications by Wade Hampton * Environment checking for CDDBHOST * Added verbosity * Added -l option to list available hosts * Some documentation and inclusion in cdtools package * * 0.1a Initial release */ #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "cdtool.h" #include "util.h" #ifdef HAVE_FCNTL_H # include #endif /* version */ #define VERSIONSTRING "0.6" /* default query host and port: */ #define CDDB_HOST "freedb.freedb.org" #define CDDB_PORT 888 /* default CD-ROM: */ #ifndef CD_DEVICE #define CD_DEVICE "/dev/cdrom" #endif typedef struct toc { int min, sec, frame; } CDTocType; CDTocType cdtoc[100]; static int sock; static int iRawMode = FALSE; char *svnid="$Id: cdown.c 1533 2005-10-17 19:11:59Z max $"; /************************************************************************/ /* Procedure: read_toc * Purpose: to read the CD-ROM's TOC * * Inputs: cd name * Outputs: to TOC structure * Returns: -1 or tochdr.cdth_trk1 (total tracks) * Notes: * 1. */ /************************************************************************/ int read_toc(char *pszCD) { int drive; struct cdrom_tochdr tochdr; struct cdrom_tocentry tocentry; int i; /* check command line args */ if (pszCD == NULL) return (-1); /* open the CD-ROM and query it for the TOC */ drive = open(pszCD, O_RDONLY | O_NONBLOCK); if (drive < 0) return (-2); if (ioctl(drive, CDROMREADTOCHDR, &tochdr) == -1) return (-3); /* parse the TOC and fill int the cddb TOC table */ for (i = tochdr.cdth_trk0; i <= tochdr.cdth_trk1; i++) { tocentry.cdte_track = i; tocentry.cdte_format = CDROM_MSF; ioctl(drive, CDROMREADTOCENTRY, &tocentry); cdtoc[i-1].min = tocentry.cdte_addr.msf.minute; cdtoc[i-1].sec = tocentry.cdte_addr.msf.second; cdtoc[i-1].frame = tocentry.cdte_addr.msf.frame; cdtoc[i-1].frame += cdtoc[i-1].min*60*75; cdtoc[i-1].frame += cdtoc[i-1].sec*75; } tocentry.cdte_track = 0xAA; tocentry.cdte_format = CDROM_MSF; ioctl(drive, CDROMREADTOCENTRY, &tocentry); cdtoc[tochdr.cdth_trk1].min = tocentry.cdte_addr.msf.minute; cdtoc[tochdr.cdth_trk1].sec = tocentry.cdte_addr.msf.second; cdtoc[tochdr.cdth_trk1].frame = tocentry.cdte_addr.msf.frame; cdtoc[tochdr.cdth_trk1].frame += cdtoc[tochdr.cdth_trk1].min*60*75; cdtoc[tochdr.cdth_trk1].frame += cdtoc[tochdr.cdth_trk1].sec*75; close(drive); return tochdr.cdth_trk1; } /************************************************************************/ /* Procedure: cddb_sum * Purpose: Checksum generation routine used by cddb_discid * * Inputs: n is the offset of the track to checksum, in seconds * Outputs: * Returns: the checksum value for n * Notes: * 1. Algorithm and code from http://www.cddb.com/ */ /************************************************************************/ unsigned int cddb_sum(int n) { unsigned int ret; ret = 0; while (n > 0) { ret += (n % 10); n /= 10; } return ret; } /************************************************************************/ /* Procedure: cddb_discid * Purpose: Generates the CDDB disc ID * * Inputs: tot_trks * Outputs: * Returns: The disc ID, as a 32 bit number * Notes: * 1. Algorithm and code from http://www.cddb.com/ */ /************************************************************************/ unsigned long cddb_discid(int tot_trks) { unsigned int i, t = 0, n = 0; i = 0; while (i < tot_trks) { n = n + cddb_sum((cdtoc[i].min * 60) + cdtoc[i].sec); i++; } t = ((cdtoc[tot_trks].min * 60) + cdtoc[tot_trks].sec) - ((cdtoc[0].min * 60) + cdtoc[0].sec); return ((n % 0xff) << 24 | t << 8 | tot_trks); } /************************************************************************/ /* Procedure: netwrite * Purpose: Completely write a buffer to a socket * * Inputs: sock - the socket * text - data to send * nchars - length of data to send * Outputs: to sock * Returns: -1 on error, 0 on success * Notes: * 1. */ /************************************************************************/ int netwrite(int sock, char *text, int nchars) { char *strLeft; int len; strLeft = text; do { len = write(sock, strLeft, nchars); /* write as much as we can */ if (len < 0) return -1; /* socket error, damn */ strLeft += len; /* move along the string */ nchars -= len; /* fewer characters to send */ } while (nchars > 0); /* until done entire string */ return 0; } /************************************************************************/ /* Procedure: netprintf * Purpose: printf() that outputs using netwrite() * * Inputs: sock - the socket to write to * fmt - format arg, passed to vsnprintf() * ... - other arguments to vsnprintf() * Outputs: * Returns: -1 on error, 0 on success * Notes: * 1. */ /************************************************************************/ int netprintf(int sock, char *fmt, ...) { char buffer[8192]; va_list args; size_t len; va_start(args, fmt); len = vsnprintf(buffer, sizeof(buffer), fmt, args); va_end(args); if (len < 1 || len > sizeof(buffer)) { fprintf(stderr, "%s len=%d in netprintf\n", (len > sizeof(buffer)) ? "truncated message" : "empty message or error", len); return -1; } return netwrite(sock, buffer, len); } /************************************************************************/ /* Procedure: netconnect * Purpose: attempt to open a TCP connection to hostname, on port * port * * Inputs: progname - used in error reporting * hostname - host to connect to * port - port number to connect to * Outputs: to stderr * Returns: the newly created socket * Notes: * 1. calls exit(3) on error */ /************************************************************************/ int netconnect(char *hostname, int port, int iVerbose) { int sock; struct hostent *host; struct sockaddr_in iaddr; if (iVerbose) fprintf(stderr, "Resolving host %s\n", hostname); /* resolve the host name */ host = gethostbyname(hostname); if (host == NULL) { errormsg("error: Getting host info for %s", hostname); errormsg("%s", strerror(errno)); return -1; } iaddr.sin_port = htons(port); iaddr.sin_addr.s_addr = *(unsigned int *)host->h_addr; iaddr.sin_family = AF_INET; /* create the socket */ if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) { fprintf (stderr, "error: Creating socket\n"); perror(" error"); return -1; } if (iVerbose) fprintf(stderr, "Connecting...\n"); /* make the connection */ if (connect(sock, (struct sockaddr *)&iaddr, sizeof(iaddr)) == -1) { fprintf (stderr, "error: Connecting to host %s port %d\n", hostname, port); perror("error"); close(sock); return -1; } return sock; } /************************************************************************/ /* Procedure: getline * Purpose: read a line of text from the CDDB server * * Inputs: * Outputs: * Returns: The line of text * Notes: * 1. The CDDB databases use \r\n to end lines. All lines returned * by getline() have the \r and \n stripped. * 2. Non-reentrant: the memory buffer returned previously is * recycled * 3. Do NOT modify the contents of the returned buffer past the * NULL - data from the network is stored there */ /************************************************************************/ char *getline(void) { static char *buffer = NULL; static char *lastline = NULL; static int buffered = 0; char newdata[1024]; char *nl = NULL; int len; /* Copy the previously buffered data and resize the buffer */ if (lastline != NULL) { memmove(lastline, buffer, buffered+1); buffer = realloc(lastline, buffered+1); } /* while an end of line marker isn't reached */ while (buffer == NULL || (nl = strchr(buffer, '\n')) == NULL) { if ((len = read(sock, newdata, 1024)) < 0) { fprintf(stderr, "error: reading from socket: %s\n", strerror(errno)); return NULL; } buffer = realloc(buffer, buffered+len+1); /* grow the buffer */ memcpy(buffer+buffered, newdata, len); /* add the new data */ buffer[buffered+len] = '\0'; /* make it asciiz */ buffered += len; } lastline = buffer; /* remember the buffer */ buffer = nl+1; /* this is the unused data */ *nl = '\0'; /* EOL marking */ buffered -= strlen(lastline)+1; /* this data is no longer buffered */ nl -= 1; /* adjust for the NULL */ if (*nl == 0x0d) *nl = '\0'; /* strip any \r's */ return lastline; /* return the data */ } /************************************************************************/ /* Procedure: signon * Purpose: parse the initial connection message * * Inputs: message - the response from the server * Outputs: to stderr * Returns: 1 on successful connect, 0 on failed connect * Notes: * 1. Displays an error message to stdout in the event of an error */ /************************************************************************/ int signon(char *message) { switch (atoi(message)) { case 200: return 1; case 201: return 1; case 432: fprintf(stderr, "error: permission denied\n"); return 0; case 433: fprintf(stderr, "error: server is full\n"); return 0; case 434: fprintf(stderr, "error: server load is too high\n"); return 0; default: fprintf(stderr, "error: bad message: %s\n", message); return 0; } } /************************************************************************/ /* Procedure: welcome * Purpose: parse the server response to ``cddb hello ...'' * * Inputs: message - the response from the server * Outputs: to stderr * Returns: 1 on success, 0 on failure * Notes: * 1. Should never get a 402, check present just in case */ /************************************************************************/ int welcome(char *message) { int status = 1; switch (atoi(message)) { case 431: fprintf(stderr, "error: handshake failed\n"); status = 0; break; case 402: fprintf(stderr, "warning: already shook hands?\n"); break; } return status; } /************************************************************************/ /* Procedure: printcd * Purpose: Tidily displays the title of a CD * * Inputs: message - the CD title as returned by CDDB * Outputs: to stderr * Returns: * Notes: * 1. Seems neat enough for the time being */ /************************************************************************/ void printcd(char *message) { fprintf(stderr, "%s\n", message); } /************************************************************************/ /* Procedure: readinfo * Purpose: download and output the track information for a CD * * Inputs: categ, discid - the identifiers used by CDDB * Outputs: to stderr and stdout * Returns: nothing * Notes: * 1. Nice to make this append to .cdtooldb when it's close enough * to bug free */ /************************************************************************/ void readinfo(char *categ, char *discid) { char *message; char *firstword; char *cdtitle; netprintf(sock, "cddb read %s %s\n", categ, discid); message = getline(); switch (atoi(message)) { case 401: fprintf(stderr, "error: entry not found\n"); return; case 402: fprintf(stderr, "error: server error\n"); return; case 403: fprintf(stderr, "error: database corrupt\n"); return; case 409: fprintf(stderr, "error: no handshake\n"); return; case 210: break; default: fprintf(stderr, "error: bad message: %s\n", message); return; } while (iRawMode) { /* infinite loop, or skip if !iRawMode */ message = getline(); if (!strcmp (message, ".")) return; printf ("%s\r\n", message); } do { message = getline(); firstword = strchr(message, '='); if (firstword != NULL) { *firstword = '\0'; if (strcmp(message, "DTITLE") == 0) { cdtitle = strchr(firstword+1, '/'); if (cdtitle == NULL) { cdtitle = firstword+1; } else { *cdtitle = ' '; while(*--cdtitle == ' ') ; *++cdtitle = '\0'; while (*++cdtitle == ' ') ; } printf("cdname %s\n", cdtitle); printf("artist %s\n", firstword+1); } else if (strncmp(message, "TTITLE", 6) == 0) { printf("track %s\n", firstword+1); } } /* printf("%s\n", message);*/ } while (strcmp(message, ".") != 0); printf("\n"); } /************************************************************************/ /* Procedure: query * Purpose: ask cddb server about CDs matching the generated discid * * Inputs: * Outputs: to stderr * Returns: * Notes: * 1. queries user if discid has multiple matches */ /************************************************************************/ void query(void) { char *message; char *categ, *discid; char **matches = NULL; int count = 0; int input = 0; int exact = 1; message = getline(); switch (atoi(message)) { case 403: fprintf(stderr, "error: database entry is corrupt\n"); return; case 409: fprintf(stderr, "error: no handshake\n"); return; case 202: fprintf(stderr, "error: no match\n"); return; case 200: message += 4; break; case 211: exact = 0; break; default: fprintf(stderr, "error: bad message: %s\n", message); return; } if (!exact) { fprintf(stderr, "CD has no exact match\n 0: None\n"); do { message = getline(); if (strcmp(message, ".") != 0) { matches = realloc(matches, sizeof(char*) * (++count)); fprintf(stderr, " %d: ", count); printcd(message); matches[count-1] = malloc(strlen(message)+1); strcpy(matches[count-1], message); } } while (strcmp(message, ".") != 0); fprintf(stderr, "Enter the number corresponding to your CD? "); scanf("%d", &input); /* could be done better? */ input--; if (input == -1) return; message = matches[input]; } categ = message; discid = strchr(categ, ' '); *discid++ = '\0'; message = strchr(discid, ' '); *message++ = '\0'; fprintf(stderr, "Reading information for %s\n", message); readinfo(categ, discid); } /************************************************************************/ /* Procedure: PrintHelp * Purpose: print help * * Inputs: prog name * Outputs: to stderr * Returns: none * Notes: * 1. */ /************************************************************************/ void PrintHelp(char *pszName) { fprintf (stderr, "%s: get CD info from cddb database\n", pszName); fprintf (stderr, "usage: cddb [-{1..9}] [-d D] [-H H] [-P P] [-v] [-V|-h|-?]\n"); fprintf (stderr, " cddb get database for default CDROM\n"); fprintf (stderr, " -d device specify the CDROM device\n"); fprintf (stderr, " -H host get database using HOST (def=%s)\n", CDDB_HOST); fprintf (stderr, " -P port get database using PORT (def=%d)\n", CDDB_PORT); fprintf (stderr, " -l list available cddb hosts\n"); fprintf (stderr, " -N, N={1..9} specify /dev/cdromN (def=%s)\n", CD_DEVICE); fprintf (stderr, " -r output raw CDDB entry\n"); fprintf (stderr, " -v verbose output\n"); fprintf (stderr, " -D enable debugging information\n"); fprintf (stderr, " -V print version, exit\n"); fprintf (stderr, " -?|-h print help, exit\n\n"); } /************************************************************************/ /* Procedure: getuname * Purpose: get the name of the user who ran the program * * Inputs: * Outputs: * Returns: buffer containing username * Notes: * 1. */ /************************************************************************/ char *getuname(void) { struct passwd *pwd; pwd = getpwuid(getuid()); return pwd->pw_name; } /************************************************************************/ /* Procedure: gethname * Purpose: get the name of the host computer * * Inputs: * Outputs: * Returns: buffer containing hostname * Notes: * 1. */ /************************************************************************/ char *gethname(void) { static char buffer[80]; /* is 80 long enough? */ /* assuming this works is a bad idea ..? */ gethostname(buffer, sizeof(buffer)); return buffer; } /************************************************************************/ /* Procedure: parsesites * Purpose: read the list of sites from the server * * Inputs: command line args * Outputs: to stdout (!) * Returns: * Notes: * 1. */ /************************************************************************/ void parsesites(void) { char *buffer; buffer = getline(); switch (atoi(buffer)) { case 210: break; /* OK */ case 401: fprintf(stderr, "error: no site list available\n"); return; } buffer = getline(); do { printf("%s\n", buffer); } while (strcmp(buffer = getline(), ".") != 0); } /************************************************************************/ /* Procedure: main * Purpose: C code main function * * Inputs: command line args * Outputs: to stdout and stderr * Returns: error code (0 if exit is OK) * Notes: * 1. */ /************************************************************************/ int main(int argc, char *argv[]) { extern int optind, getopt(); extern char *optarg; int iListMode = FALSE; int error = 0; char *pszHost = NULL; char *progname = NULL; int iPort = CDDB_PORT; int opt; unsigned long discid; int tracks, i; char *bleh; char *device = NULL; progname = setprogname("cdown"); cdtool_show_debug = FALSE; cdtool_show_verbose = FALSE; cdtool_show_crlf = DOLF; /* parse environment and command line args */ if ((pszHost = getenv("CDDBHOST")) == NULL) pszHost = strdup(CDDB_HOST); while ((opt = getopt(argc,argv,"0123456789?DhlrVvH:P:d:")) != EOF) { switch (opt) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': device = strdup(CD_DEVICE "?"); *(device + sizeof(CD_DEVICE)-1) = opt; break; case 'd': device = optarg; break; case 'H': pszHost = optarg; break; case 'P': iPort = atoi(optarg); break; case 'l': iListMode = TRUE; break; case 'r': iRawMode = TRUE; break; case 'v': cdtool_show_verbose = TRUE; break; case 'D': cdtool_show_debug = TRUE; break; case 'V': printf ("%s %s\n", progname, VERSIONSTRING); printf ("Build %s %s [%s]\n",__DATE__,__TIME__, svnid); exit(0); /* general options */ case '?': case 'h': default: error = 1; break; } } /* if error, print help and exit */ if (error == 1) { PrintHelp(progname); exit(1); } /* try to find the CDROM */ if ((device = device_detect(device)) == NULL) { errormsg("%s: no cdrom found. Try option -d ", progname); PrintHelp(progname); exit(1); } debugmsg("connecting to host=%s port=%d", pszHost, iPort); /* connect to the host, if we fail, print error and exit */ if ((sock = netconnect(pszHost, iPort, cdtool_show_verbose)) < 0) { /* error message has already been printed */ exit(3); } bleh = getline(); if (!signon(bleh)) { errormsg("%s: signon error on host %s", progname, pszHost); close(sock); exit(3); } if (cdtool_show_verbose) fprintf(stderr, "Logging in\n"); debugmsg("sending to CDDB server >> cddb hello %s %s %s %s", getuname(), gethname(), progname, VERSIONSTRING); /* send connect string */ netprintf(sock, "cddb hello %s %s %s %s\n", getuname(), gethname(), progname, VERSIONSTRING); /* get welcome message */ bleh = getline(); if (!welcome(bleh)) { errormsg("%s: bad welcome message [%s]", progname, bleh); close(sock); exit(3); } if (cdtool_show_verbose) fprintf(stderr, "Querying\n"); /* Listing available hosts or querying database? */ if (iListMode) { netprintf(sock, "sites\n"); parsesites(); } else { /* open CD, read tracks, if fail, report error and exit */ tracks = read_toc(device); if (tracks < 0) { errormsg("%s: error reading cdrom %s", progname, device); exit(-1); } /* generate discid */ discid = cddb_discid(tracks); /* do the query */ netprintf(sock, "cddb query %08x %d", discid, tracks); /* TODO don't print this if there are no matches, or if None is * selected */ if (!iRawMode) printf("tracks %d", tracks); for (i = 0; i < tracks; i++) { netprintf(sock, " %d", cdtoc[i].frame); if (!iRawMode) printf(" %d", cdtoc[i].frame); } netprintf(sock, " %d\n", (cdtoc[tracks].frame-cdtoc[0].frame)/75); if (!iRawMode) printf(" %d\n", (cdtoc[tracks].frame)/75); query(); netprintf(sock, "quit\n"); } exit(0); } cdtool-2.1.8/cdctrl.c0000644000000000000000000002266410324773577013154 0ustar rootroot/* * Module: cdctrl.c * Purpose: to control Linux CD-ROMs * Author: Wade Hampton * * Copyright (C) 1997, 1998, Wade Hampton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 dated June, 1991. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include #include "config.h" #include "cdtool.h" #include "commands.h" #include "hardware.h" #include "info.h" #include "shuffle.h" #include "util.h" #define CD_DEVICE "/dev/cdrom" /* CONSTANTS- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ static char svnid[] = "$Id: cdctrl.c 1533 2005-10-17 19:11:59Z max $"; /* LOCAL DATA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ char caLineIn[BUFSIZ]; /* PROTOTYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ void print_userhelp(int iVersion); void print_help(void); void print_info(cdtool_t *cdtool, char *pszCmd); int cmd_parse (cdtool_t *cdtool, char *pszBuf, int iRead); /************************************************************************/ /* Procedure: print_userhelp * Purpose: to print command and user help on commands * * Inputs: none * Outputs: to stdout, to stderr * Returns: none * Notes: * 1. */ /************************************************************************/ void print_userhelp(int iVersion) { printf ("cdctrl:\nCommand line CDROM control\nOptions:\n"); printf (" cdctrl -c device -- output using CRLF\n"); printf (" cdctrl device -- normal output\n"); printf (" cdctrl [-h|-?|-V] -- help/version\n"); if (iVersion == TRUE) { printf (" Version %s\n", svnid); printf (" Built on %s %s\n", __DATE__, __TIME__); } else { printf ("Command-line control options are:\n"); print_help (); } } /************************************************************************/ /* Procedure: print_help * Purpose: to print help on commands * * Inputs: none * Outputs: to stdout, to stderr * Returns: none * Notes: * 1. */ /************************************************************************/ void print_help () { infomsg("1 play (start play at track 1)"); infomsg("s stop"); infomsg("p pause"); infomsg("r resume"); infomsg("e eject"); infomsg("c close"); infomsg("i info"); infomsg("d dir"); infomsg("l shuffle (1 track only)"); infomsg("- previous track"); infomsg("+ next track"); infomsg("N play track N"); infomsg("q quit"); infomsg("? help"); infomsg("info format: \"CMD cmd-name cd-status track abs-time rel-time\""); infomsg(" cmd-name := {play, stop, ... quit} from above list"); infomsg(" cd-status := {invalid, play, paused, completed, error, no status}"); infomsg(" track := {1..99} CD track"); infomsg(" abs-time := HH:MM:SS elapsed since CD start"); infomsg(" rel-time := HH:MM:SS elapsed since track start"); infomsg("Build: %s %s [%s]", __DATE__, __TIME__, svnid); } /************************************************************************/ /* Procedure: print_info * Purpose: to print info on status * * Inputs: command, device of CDROM * Outputs: to stdout, to stderr * Returns: none * Notes: * 1. */ /************************************************************************/ void print_info(cdtool_t *cdtool, char *pszCmd) { printf ("CMD %s ", pszCmd); do_info (cdtool, I_DISP_ALL); } /************************************************************************/ /* Procedure: cmd_parse * Purpose: to parse user's commands * * Inputs: program name, file description for CDROM, buffer, * count, device of CDROM * Outputs: to CDROM, to stdout, to stderr * Returns: T/F, T when "done" * Notes: * 1. */ /************************************************************************/ int cmd_parse (cdtool_t *cdtool, char *pszBuf, int iRead) { int iDone = FALSE; int iTrk; char *pszCmd; pszCmd = "NULL"; if ((pszBuf[0] >= '0') && (pszBuf[0] <= '9')) { iTrk = atoi (pszBuf); do_play(cdtool, iTrk, 0); pszCmd = "play"; } else { /* handle commands.... */ switch (pszBuf[0]) { case 's': do_stop(cdtool, 99); pszCmd = "stop"; break; case 'p': do_pause(cdtool); pszCmd = "pause"; break; case 'r': do_play(cdtool, 0, 0); pszCmd = "resume"; break; case 'e': do_eject(cdtool); sleep (3); pszCmd = "eject"; break; case 'c': do_close(cdtool); sleep (3); pszCmd = "close"; break; case 'i': case 0x0d: case 0x0a: pszCmd = "info"; break; case 'd': do_dir (cdtool, P_RAW, 0); pszCmd = "dir"; break; case '-': do_skip(cdtool, SKIPBACK, 1); pszCmd = "previous"; break; case '+': do_skip(cdtool, SKIPFORWARD, 1); pszCmd = "next"; break; case 'q': iDone = TRUE; pszCmd = "QUIT"; break; case 'l': do_shuffle (cdtool, 99, 1, 1); pszCmd = "shuffle"; break; case '?': print_help(); pszCmd = "help"; break; default: errormsg("ERROR invalid command %s", pszBuf); pszCmd = "default"; break; } } print_info(cdtool, pszCmd); infomsg ("END"); return (iDone); } /************************************************************************/ /* Procedure: main * Purpose: cdctrl's main * * Inputs: command line args * Outputs: to CDROM, to stdout, to stderr * Returns: T/F, T when "done" * Notes: * 1. */ /************************************************************************/ int main (int argc, char *argv[]) { cdtool_t cdtool; extern int optind, getopt(); extern char *optarg; char *device = NULL; int opt=1; int iRead; int iDone = FALSE; setprogname("cdctrl"); cdtool.device = NULL; cdtool_show_crlf = DOLF; cdtool_show_debug = FALSE; cdtool_show_verbose = FALSE; /* parse environment and command line args */ while (argv[opt] != NULL && argv[opt][0] == '-') { switch (argv[opt][1]) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': device = strdup(CD_DEVICE "?"); *(device + sizeof(CD_DEVICE)-1) = argv[opt][1] - '0'; argv++; argc--; break; case 'd': if (argv[opt+1] == NULL) { errormsg("%P: -d needs an argument"); exit(1); } device = argv[opt+1]; argv += 2; argc -= 2; break; case 'D': cdtool_show_debug = TRUE; argv++; argc--; break; case 'v': cdtool_show_verbose = TRUE; argv++; argc--; break; case 'c': cdtool_show_crlf = DOCRLF; argv++; argc--; break; case 'h': case 'V': case '?': print_userhelp(FALSE); exit(0); default: errormsg("%P: unknown option: %s", argv[opt]); exit(1); } } if (argc > 1) device = argv[opt]; /* close stderr and redirect to stdout */ close(2); dup2(1, 2); /* try to open the CD device(s) */ if (cdtool_open(&cdtool, device) < 0) exit(1); infomsg("Opened %s as device %d", cdtool.device, cdtool.fd); /* process commands */ while (iDone == FALSE) { if (update_hw(cdtool.hw, cdtool.fd) < 0) { errormsg("Error reading from hardware\n"); break; } if (fgets(caLineIn, sizeof(caLineIn)-1, stdin) != NULL) { iRead = strlen(caLineIn); if (iRead > 0) { iDone = cmd_parse(&cdtool, caLineIn, iRead); } } fflush (stdout); } /* cleanup */ close (cdtool.fd); infomsg("EXITING"); return (TRUE); } /* * Revision History: (no longer updated) * * Language/Compiler/O/S: GCC 2.7.2, Linux 2.0.X * Date: 12/22/97 * * [from RCS] * * $Log: cdctrl.c,v $ * Revision 1.6 1998/07/15 13:49:58 wadeh * prior to Lin's changes * * Revision 1.5 1998/01/06 21:00:33 wadeh * Added DoCr, changes to fix cdeject crash. * * Revision 1.4 1997/12/30 22:59:31 wadeh * Added fflush to properly work with pipes... * * Revision 1.3 1997/12/24 15:39:10 wadeh * Minor bug fixes: * 1) Fixed cdctrl eject command causing a signal 11. * 2) Fixed Makefile debug option to not strip symbols, can now debug. * 3) Added command.h and more prototypes, more documentation. * 4) Fixed read_hw to always return buffer, even on error. * , * * Revision 1.2 1997/12/23 22:52:51 wadeh * 2.1 beta 1 release * * Revision 1.1 1997/12/23 21:38:52 wadeh * Initial revision * * * Notes: * 1) */ cdtool-2.1.8/config.sub0000755000000000000000000007577710320237042013507 0ustar rootroot#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-07-08' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ms1 \ | msp430 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m32c) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | ms1-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; m32c-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: cdtool-2.1.8/CREDITS0000644000000000000000000000225610324773466012545 0ustar rootrootThe people behind CDTOOL ------------------------ Many different people have made contributions to CDTOOL. I tried to list here everyone who has sent in a patch, wrote documentation or contributed to CDTOOL in another way. Andrea Fanfani Arnaud Patard Byron Ellacott Dan Risacher Fred Baumgarten Gergely Nagy Ingo Wilken Jakob Bratkovic Josh Buhl Kevin Ryde Lin Zhe Min Martin Mitchell Max Vozeler Mike Coleman Olav Woelfelschneider Peter Samuelson Richard Kettlewell Roland Rosenfeld Sven Oliver Moll Thomas Insel Wade Hampton [ It may well be that I missed someone. If you feel you should be in this list, please send me a message at max@hinterhof.net -- max ] cdtool-2.1.8/util.c0000644000000000000000000002030310324773577012642 0ustar rootroot/* * util.c * * Copyright 2004, Max Vozeler * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include "util.h" #if HAVE_MNTENT_H #include #endif /* globals */ int cdtool_show_crlf = DOLF; int cdtool_show_verbose = FALSE; int cdtool_show_debug = FALSE; char *cdtool_progname = "unknown"; /* * */ char *device_detect(char *choice) { char dev[PATH_MAX]; struct device_name *m; int i; /* device name, number of subdevices */ static struct device_name { char *name; int subcount; } device_map[] = { { "/dev/cdrom", 1 }, /* Linux default */ { "/dev/cdrom%d", 16 }, /* Other Linuxes? */ { "/dev/scd%d", 16 }, /* Linux SCSI */ { "/dev/sonycd", 1 }, /* Sony */ { "/dev/mcd", 1 }, /* Mitsumi */ { "/dev/sbpcd", 1 }, /* SoundBlaster Pro */ /* { "/dev/sr%d", 16 }, */ /* Sun SCSI (?) */ { "/vol/dev/aliases/cdrom%d", 16 }, /* Sun Volume Manager */ { NULL, 0 } }; /* user choice; display any error messages */ if (choice != NULL || (choice = getenv("CDTOOLDEV")) != NULL) { if (!is_device(choice, 1)) return NULL; return choice; } /* try detection */ m = &device_map[0]; while (m->name != NULL) { i = 0; while (m->subcount > i) { snprintf(dev, sizeof(dev), m->name, i); if (is_device(dev, 0)) { /* found */ debugmsg("using detected cd_device=%s", dev); return strdup(dev); } i++; } m++; } return NULL; } /* * */ int is_device(char *path, int verbose) { struct stat s; if (stat(path, &s) != 0) { if (verbose) errormsg("%P: can't open cdrom (%s): %s", path, strerror(errno)); return 0; } if (!S_ISBLK(s.st_mode)) { if (verbose) errormsg("%P: can't open cdrom (%s): not a block device.", path); return 0; } return 1; } void show_permissions(char *device) { struct stat sb; struct group *g; gid_t groups[1024]; int ngroups; if (stat(device, &sb) < 0) { errormsg("%P: cannot stat %s: %s", device, strerror(errno)); } else { if (!(sb.st_mode & 0040)) { errormsg(" %s is not group-readable."); errormsg(" Try, as root: chmod g+r %s", device, device); } if (!(g = getgrgid(sb.st_gid))) { errormsg(" %s is owned by unknown group %lu%s", device, (unsigned long)sb.st_gid); errormsg(" Try, as root: chgrp --dereference cdrom %s", device); } else if (strcmp(g->gr_name, "cdrom")) { errormsg(" %s is owned by group \"%s\"", device, g->gr_name); errormsg(" Try, as root: chgrp --dereference cdrom %s", device); } } if (!(g = getgrnam("cdrom"))) { errormsg(" This system appears to have no cdrom group!"); errormsg(" Try, as root: addgroup cdrom"); } else { if ((ngroups = getgroups(sizeof groups/sizeof *groups, groups)) < 0) errormsg("%P: cannot get group list: %s", strerror(errno)); else { int found = 0; while (ngroups--) { if (groups[ngroups] == g->gr_gid) { found = 1; break; } } if (!found) { struct passwd *p; p = getpwuid(getuid()); errormsg(" You are not in the \"cdrom\" group."); errormsg(" Try, as root: adduser %s cdrom", p ? p->pw_name : ""); errormsg(" You will need to log in again before this" "change takes effect"); } } } } /************************************************************************/ /* Procedure: checkmount * Purpose: to check if this CD is mounted * * Inputs: name of program, name of CD-ROM * Outputs: debug * Returns: T/F * Notes: */ /************************************************************************/ int checkmount(char *pszName) { #if HAVE_MNTENT_H FILE *fp; struct mntent *mnt; int ii; char caB[100]; char *pszTest; /* find out if the device is a link, resolve link name */ ii = readlink(pszName, caB, sizeof(caB)-1); if (ii < 0) { pszTest = pszName; debugmsg("checkmount: %s not a link", pszName); } else { pszTest = &caB[0]; caB[ii] = '\0'; debugmsg("checkmount: link -> %s", caB); } /* check if drive is mounted (from Mark Buckaway's cdplayer code) */ if ((fp = setmntent (MOUNTED, "r")) == NULL) { errormsg("%s: Couldn't open %s: %s", pszName, MOUNTED, strerror (errno)); return (-1); } while ((mnt = getmntent (fp)) != NULL) { if (strstr (mnt->mnt_fsname, pszTest) != NULL) { endmntent (fp); return (TRUE); } } endmntent (fp); #endif return (FALSE); } /* * Solaris needs this * */ #ifndef HAVE_STRSEP char *strsep(char **stringp, const char *delim) { char *str = *stringp; char *end; if (!str) return NULL; end = strpbrk(str, delim); if (end) *end++ = '\0'; *stringp = end; return str; } #endif /* * */ void do_crlf(FILE *term) { static char *newline[] = { "", "\n", "\r\n" }; fprintf(term, "%s", newline[cdtool_show_crlf]); } void bugfound(char *message, char *file, char *function, int line) { struct utsname uts; uname(&uts); errormsg("\n" "===========================================================\n" "BUG: %s at file %s, function %s (line %d)\n", message, file, function, line); errormsg( "Oops. Looks like you found a bug in cdtool. Please send this\n" "message along with other information that you think could be\n" "useful to cdtool-devel@lists.hinterhof.net. Thanks.\n" ); errormsg("CDTOOL %s running on %s", PACKAGE_VERSION, uts.sysname); errormsg(" %s %s %s (version %s)", uts.machine, uts.sysname, uts.release, uts.version); errormsg("===========================================================\n"); } void usermsg(FILE *term, char *fmt, va_list args) { if (strncmp(fmt, "%P", 2) == 0) { fprintf(term, "%s", cdtool_progname); fmt += 2; } vfprintf(term, fmt, args); do_crlf(term); } void debugmsg(char *fmt, ...) { va_list args; if (!cdtool_show_debug) return; va_start(args, fmt); usermsg(stderr, fmt, args); va_end(args); } void errormsg(char *fmt, ...) { va_list args; va_start(args, fmt); usermsg(stderr, fmt, args); va_end(args); } void verbosemsg(char *fmt, ...) { va_list args; if (!cdtool_show_verbose) return; va_start(args, fmt); usermsg(stdout, fmt, args); va_end(args); } void infomsg(char *fmt, ...) { va_list args; va_start(args, fmt); usermsg(stdout, fmt, args); va_end(args); } char *getprogname(void) { return cdtool_progname; } char *setprogname(char *name) { char *p; p = strrchr(name, '/'); if (!p) p = name; else p++; cdtool_progname = p; return p; } cdtool-2.1.8/cdadd.10000644000000000000000000000173610102704527012632 0ustar rootroot.TH CDADD 1 29-July-2004 CDTOOL "User Commands" .\" manual page copyright 1994 thomas insel .\" copyright 1995,96 sven oliver moll .SH NAME cdadd \- add information for a new CD to .cdtooldb .SH SYNOPSIS .nf \fBcdadd\fR [-[0..9]|-d device] .fi .SH DESCRIPTION The .I cdadd command is a shell script which uses .I cdir -t and assists users in adding a new entry to the .B ~/.cdtooldb database file. It allows the user to edit a blank template database entry for the current compact disc, and then appends it to the file. .SH FILES .B ~/.cdtooldb - default database file. .SH ENVIRONMENT .B CDTOOLDBPATH - colon delimited path of database files to search. It is not necessary to specify .BR ~/.cdtooldb , as this is automatically added to the end of the search path. .PP .B CDTOOLDEV - device file for cd-rom, overrides compile-time defaults. .SH SEE ALSO cdtool(1) .SH AUTHORS .nf .RS Thomas Insel Sven Oliver Moll .RE .fi cdtool-2.1.8/configure.ac0000644000000000000000000000407410466315122013777 0ustar rootrootdnl dnl Copyright 2004-2005, Max Vozeler dnl Distributed under the GNU GPL. dnl dnl Process with autoconf to produce a configure script. dnl AC_PREREQ(2.59) AC_INIT(CDTOOL, 2.1.8, cdtool-devel@lists.hinterhof.net) AC_CONFIG_HEADER([config.h]) dnl Checks for programs. AC_PROG_CC AC_PROG_GCC_TRADITIONAL AC_PROG_INSTALL AC_PROG_LN_S AC_CHECK_TOOL(STRIP, strip, :) dnl Checks for libraries. AC_CHECK_LIB(socket, connect) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_TIME AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([getopt.h mntent.h sys/mnttab.h ioctl.h sys/ioctl.h fcntl.h]) AC_CHECK_HEADERS([sys/cdio.h], [cdrom_header="sys/cdio.h"]) AC_CHECK_HEADERS([linux/cdrom.h], [cdrom_header="linux/cdrom.h"]) if test -z "$cdrom_header"; then AC_MSG_ERROR([No cdrom header]) fi AC_DEFUN(CHECK_IOCTL, [ ioctl=$1 AC_MSG_CHECKING(for ioctl $ioctl) AH_TEMPLATE(AS_TR_CPP(HAVE_IOCTL_[$1]), [Define to 1 if you have the ioctl $1]) AC_EGREP_CPP(have_$ioctl, [#include <$cdrom_header> #ifdef $ioctl have_$ioctl #endif ], [ found=yes ], [ found=no ]) AC_MSG_RESULT($found) if test "$found" = "yes"; then AC_DEFINE_UNQUOTED([HAVE_IOCTL_$ioctl], [1]) fi ]) CHECK_IOCTL(CDROMRESET) CHECK_IOCTL(CDROMCLOSETRAY) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_UID_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SIGNAL AC_C_CONST dnl Checks for library functions. AC_FUNC_GETGROUPS AC_FUNC_GETMNTENT AC_CHECK_FUNCS([strsep memmove memset socket gethostbyname]) AC_SEARCH_LIBS(gethostbyname, nsl) dnl Option --disable-scsi AC_MSG_CHECKING(whether to disable SCSI code) AC_ARG_ENABLE(scsi, AC_HELP_STRING([--disable-scsi], [Disable SCSI code (default: no)]), [disable_scsi=yes], [disable_scsi=no]) AC_MSG_RESULT($disable_scsi) if test "$disable_scsi" = "yes"; then MYCFLAGS="${MYCFLAGS} -DNOSCSI" fi dnl Compiler flags if test "$GCC" = yes; then MYCFLAGS="${MYCFLAGS} ${CFLAGS} -Wall" fi MYBUILDDATE=`date +%Y%m%d` AC_SUBST(MYCFLAGS) AC_SUBST(MYBUILDDATE) AC_SUBST(PACKAGE_NAME) AC_SUBST(PACKAGE_VERSION) AC_CONFIG_FILES([Makefile]) AC_OUTPUT cdtool-2.1.8/util.h0000644000000000000000000000214710222554477012646 0ustar rootroot#ifndef _UTIL_H #define _UTIL_H #include #include #include #include "config.h" #include "cdtool.h" /* version string printed with usage message */ #define VERSION_STRING "CDTOOL " PACKAGE_VERSION \ " (c) 1994-2004 Thomas Insel, et al. Licensed under GPL." /* general definitions */ #ifndef TRUE #define TRUE (1==1) #endif #ifndef FALSE #define FALSE (1==0) #endif #define DOCRLF 2 #define DOLF 1 #define DONADA 0 #define BUGFOUND(x) bugfound(x, __FILE__, __FUNCTION__, __LINE__); extern int cdtool_show_crlf; extern int cdtool_show_verbose; extern int cdtool_show_debug; #ifndef HAVE_STRSEP char *strsep(char **stringp, const char *delim); #endif void debugmsg(char *fmt, ...); void errormsg(char *fmt, ...); void verbosemsg(char *fmt, ...); void infomsg(char *fmt, ...); void bugfound(char *message, char *file, char *function, int line); void show_permissions(char *device); void do_crlf(FILE *term); char *device_detect(char *choice); int is_device(char *path, int verbose); int checkmount(char *pszName); char *getprogname(void); char *setprogname(char *name); #endif cdtool-2.1.8/cdtool.lsm0000644000000000000000000000275110466315333013516 0ustar rootrootBegin4 Title: CDTOOL CD-ROM Audio Disc Utilities Version: 2.1.8 Entered-date: 2006-08-09 Description: CDTOOL is a free software package to control the audio functions of an attached CD-ROM drive from the command line in a quick and scriptable way. . CDTOOL consists of several programs. Some examples: cdown reads track info and queries a CDDB database for info on the current CD. cdctrl is a command line utility for controlling a CD-ROM drive from scripts. cdir keeps track of the contents of different CDs using a workman-compatible database. Other commands include: cdplay, cdpause, cdstop, cdeject, cdclose, cdshuffle, cdadd, cdvolume and cdloop. Keywords: CD-ROM, compact disc, CD, audio, music, console, command line Author: tinsel@tinsel.org (Thomas Insel) smol0075@rz.uni-hildesheim.de (Sven Oliver Moll) Maintained-by: max@hinterhof.net (Max Vozeler) Primary-site: http://hinterhof.net/cdtool/dist/ cdtool-2.1.8.tar.gz cdtool-2.1.8.tar.gz.asc Platforms: CDTOOL is known to compile on Debian GNU/Linux (all architectures); It is known to work on Linux x86 and powerpc. If you are using a different platform with or without success, please let us know about it at cdtool-devel@lists.hinterhof.net Copying-policy: GPL End cdtool-2.1.8/cdtool.c0000644000000000000000000002722210324766126013150 0ustar rootroot/* * CDTOOL is a program to play and catalog audio compact discs on * a cdrom drive * * Copyright 1994 Thomas Insel. * Copyright 1995,96 Sven Oliver Moll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 dated June, 1991. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * with this program; if not, write to the Free Software Foundation, * Inc., 675 Mass Ave., Cambridge, MA 02139, USA. * * For information on CDTOOL, alternate licensing, or whatever, * contact Thomas Insel via email (tinsel@uiuc.edu) or write to * Thomas Insel, 210 Parkview Drive, Bloomington, IL 61701-2038. * * Multiple cdrom drive support * cdinfo command * skip track option * some minor enhanchments * and some bugs fixed * by * Sven Oliver Moll * */ #include #include #include #include #include #include #include #include "config.h" #include "cdtool.h" #include "commands.h" #include "shuffle.h" #include "hardware.h" #include "info.h" #include "util.h" #define CD_DEVICE "/dev/cdrom" static char *svnid = "$Id: cdtool.c 1529 2005-10-17 18:24:22Z max $"; void do_usage(char *progname); /************************************************************************/ /* Procedure: main * Purpose: C code main function * * Inputs: command line args * Outputs: to stdout * Returns: error code (0 if exit is OK) * Notes: * 1. */ /************************************************************************/ int main(int argc, char *argv[]) { cdtool_t cdtool; int info=I_AUDIOSTATUS, error=0, opt, trk0=0, trk1=0; extern int optind, getopt(); extern char *optarg; char p_format = P_LONG; char *device = NULL; char *progname = NULL; int usedb = 1; int iRepeat = 1; int iTracks = 100; int iCDNum = 0; progname = setprogname(argv[0]); cdtool.device = NULL; cdtool_show_debug = FALSE; cdtool_show_verbose = FALSE; cdtool_show_crlf = DOLF; while((opt = getopt(argc,argv,"0123456789?ad:Dhi:nrstvVp:R:T:")) != EOF) { switch(opt) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': device = strdup(CD_DEVICE "?"); *(device + sizeof(CD_DEVICE)-1) = opt; iCDNum = opt - '0'; break; case 'a': error = 1; if (strcmp(progname, "cdinfo") == 0) { error = 0; info = I_DISP_ABS; } break; case 'd': device=optarg; break; case 'n': error = 1; if (strcmp(progname, "cdir") == 0) { error = 0; usedb = 0; } break; case 'r': error = 1; if (strcmp(progname, "cdir") == 0) { error = 0; p_format = P_RAW; } if (strcmp(progname, "cdinfo") == 0) { error = 0; info = I_DISP_REL; } break; case 's': error = 1; if (strcmp(progname, "cdir") == 0) { error = 0; p_format = P_QUICK; } if (strcmp(progname, "cdinfo") == 0) { error = 0; info = I_AUDIOSTATUS; } break; case 't': error = 1; if (strcmp(progname, "cdir") == 0) { error = 0; p_format = P_TEMPL; } if (strcmp(progname, "cdinfo") == 0) { error = 0; info = I_TRACK; } break; /* verbose info printout */ case 'v': cdtool_show_verbose = TRUE; error = 1; if ((strcmp(progname, "cdshuffle") == 0) || (strcmp(progname, "cdvolume") == 0) || (strcmp(progname, "cdplay") == 0) || (strcmp(progname, "cdstart") == 0)) { error = 0; } else if (strcmp(progname, "cdir") == 0) { error = 0; usedb = 1; } else if (strcmp(progname, "cdinfo") == 0) { error = 0; info = I_DISP_ALL; } break; /* for debug, overload the program name, e.g., */ /* cdtool -p info is the same as cdinfo */ case 'p': progname = setprogname(optarg); error = 0; break; case 'R': if ((strcmp(progname, "cdshuffle") == 0) || (strcmp(progname, "cdstart") == 0) || (strcmp(progname, "cdplay") == 0)) { error = 0; iRepeat = atoi(optarg); } break; case 'T': if ((strcmp(progname, "cdshuffle") == 0) || (strcmp(progname, "cdstart") == 0) || (strcmp(progname, "cdplay") == 0)) { error = 0; iTracks = atoi(optarg); } break; case 'D': /* enable debugging */ cdtool_show_debug = TRUE; break; /* print version number and then standard HELP */ case 'V': printf("%s %s\n", progname, VERSION_STRING); printf("Build: %s %s [%s]\n",__DATE__,__TIME__, svnid); exit(0); /* general options */ case '?': case 'h': default: error = 1; break; } } if (error) { do_usage(progname); exit(1); } if (cdtool_open(&cdtool, device) < 0) { exit(1); } if ((strcmp(progname, "cdplay") == 0) || (strcmp(progname, "cdstart") == 0)) { if (optind < argc) trk0=atoi(argv[optind++]); if (optind < argc) trk1=atoi(argv[optind]); optind--; if (strcmp(argv[optind],"-") == 0) { do_skip(&cdtool, SKIPBACK, 1); close(cdtool.fd); exit(0); } if (strcmp(argv[optind],"+") == 0 ) { do_skip(&cdtool, SKIPFORWARD, 1); close(cdtool.fd); exit(0); } if (strcmp(argv[optind],"?") == 0 ) { do_usage(progname); exit(0); } if ((strcmp(argv[optind],"start") == 0) || (strcmp(argv[optind],"x") == 0 ) || (strcmp(argv[optind],"0") == 0 )) { trk0=SKIPSTART; } if (strcmp(argv[optind],"stop") == 0) { do_stop(&cdtool, iCDNum); close(cdtool.fd); exit(0); } if (strcmp(argv[optind],"pause") == 0) { do_pause(&cdtool); close(cdtool.fd); exit(0); } if (strcmp(argv[optind],"eject") == 0) { do_eject(&cdtool); close(cdtool.fd); exit(0); } if (strcmp(argv[optind],"close") == 0) { do_close(&cdtool); close(cdtool.fd); exit(0); } if (strcmp(argv[optind],"info") == 0) { do_info(&cdtool, I_DISP_ALL); do_crlf(stdout); close(cdtool.fd); exit(0); } if (strcmp(argv[optind],"dir") == 0) { do_dir(&cdtool, P_RAW, 0); close(cdtool.fd); exit(0); } if (strcmp(argv[optind],"resume") == 0) do_play(&cdtool, 0, 0); if (strcmp(argv[optind],"shuffle") == 0) do_shuffle(&cdtool, iCDNum, iTracks, iRepeat); if (strcmp(argv[optind],"volume") == 0) { if(++optind < argc) { int vol=atoi(argv[optind]); int ret; ret = do_volume(&cdtool, vol); exit(ret); } } do_play(&cdtool, trk0, trk1); } else if (strcmp(progname, "cdstop") == 0) do_stop(&cdtool, iCDNum); else if (strcmp(progname, "cdeject") == 0) do_eject(&cdtool); else if (strcmp(progname, "cdclose") == 0) do_close(&cdtool); else if (strcmp(progname, "cdreset") == 0) do_reset(&cdtool); else if (strcmp(progname, "cdpause") == 0) do_pause(&cdtool); else if (strcmp(progname, "cdshuffle") == 0) do_shuffle(&cdtool, iCDNum, iTracks, iRepeat); else if (strcmp(progname, "cdinfo") == 0) { do_info(&cdtool, info); do_crlf(stdout); } else if (strcmp(progname, "cdir") == 0) do_dir(&cdtool, p_format, usedb); else if (strcmp(progname, "cdvolume") == 0) { if (optind < argc) { int vol=atoi(argv[optind]); int ret; ret = do_volume(&cdtool, vol); exit(ret); } else do_usage(progname); } else do_usage(progname); close(cdtool.fd); exit(0); } /************************************************************************/ /* Procedure: do_usage * Purpose: to print usage info (help) * * Inputs: program name * Outputs: to stderr * Returns: n/a * Notes: * 1. */ /************************************************************************/ void do_usage(char *progname) { fprintf(stderr, "%s", VERSION_STRING); fprintf(stderr,"\n"); if ((strcmp(progname, "cdplay") == 0) || (strcmp(progname, "cdstart") == 0)) { fprintf(stderr, "usage: %s [start [stop]]\n", progname); fprintf(stderr, " + next track\n"); fprintf(stderr, " - previous track\n"); fprintf(stderr, " x restart at track 1\n"); fprintf(stderr, " S play track S\n"); fprintf(stderr, " S E play track S..E\n"); fprintf(stderr, " start play from track 1\n"); fprintf(stderr, " stop stop playing\n"); fprintf(stderr, " resume resume playing\n"); fprintf(stderr, " eject eject CD-ROM\n"); fprintf(stderr, " close close CD-ROM tray\n"); fprintf(stderr, " info display info\n"); fprintf(stderr, " dir display directory\n"); fprintf(stderr, " shuffle shuffle play\n"); fprintf(stderr, " -v verbose output\n"); fprintf(stderr, " -R rr times to repeat the CDROM (shuffle only)\n"); fprintf(stderr, " -T tt max tracks to play (shuffle only)\n"); } else if (strcmp(progname, "cdshuffle") == 0) { fprintf(stderr, "usage: cdshuffle [options]\n"); fprintf(stderr, " -R rr times to repeat the CDROM\n"); fprintf(stderr, " -T tt max tracks to play\n"); fprintf(stderr, " -v verbose output\n"); } else if (strcmp(progname, "cdstop") == 0) fprintf(stderr, "usage: cdstop [options]\n"); else if (strcmp(progname, "cdeject") == 0) fprintf(stderr, "usage: cdeject [options]\n"); else if (strcmp(progname, "cdclose") == 0) fprintf(stderr, "usage: cdclose [options]\n"); else if (strcmp(progname, "cdvolume") == 0) fprintf(stderr, "usage: cdvolume [0-255]\n"); else if (strcmp(progname, "cdpause") == 0) { fprintf(stderr, "usage: cdpause [options]\n"); fprintf(stderr, " resume play with cdplay/cdstart\n"); } else if (strcmp(progname, "cdir") == 0) { fprintf(stderr, "usage: cdir [ [-n] {-s|-t} ]\n"); fprintf(stderr, " -n listing without titles\n"); fprintf(stderr, " -r raw read of toc\n"); fprintf(stderr, " -s short listing (title/artist/track)\n"); fprintf(stderr, " -t print template for database entry\n"); } else if (strcmp(progname, "cdinfo") == 0) { fprintf(stderr, "usage: cdinfo [ {-a|-r|-s|-t} ]\n"); fprintf(stderr, " -a print absolute disc time\n"); fprintf(stderr, " -r print relative track time\n"); fprintf(stderr, " -s print audiostatus\n"); fprintf(stderr, " -t print current track\n"); fprintf(stderr, " -v print status, track, absolute, relative\n"); } else fprintf(stderr, "Please call as cdplay/cdstart, cdstop, cdeject, cdclose,\n\ cdvolume, cdpause, cdir, cdinfo, or cdshuffle\n"); /* standard options below here: */ fprintf(stderr, " -V build, version, and this help\n"); fprintf(stderr, " -? -h print this message\n"); fprintf(stderr, " -[0-9] use device " CD_DEVICE "[0-9]\n"); fprintf(stderr, " -d dev use device dev\n"); fprintf(stderr, " -D enable debugging information\n"); } cdtool-2.1.8/INSTALL0000644000000000000000000002472210466315122012544 0ustar rootrootINSTALL NOTES for CDTOOL 2.1.8 - 2006-08-09 ============================================================================ Notes on Portability ==================== CDTOOL is mainly developed on GNU/Linux systems these days. If you are using a different platform, you may find that CDTOOL doesn't build or work correctly without some changes. Please let us know how it goes, and ideally send us some clues for making it work on your platform. Building ======== You need GNU make and gcc installed to build CDTOOL. Those two commands are then usually enough to build the binaries: $ ./configure $ make You may want to change some settings by passing arguments to configure. See "Configure" below and the output of configure --help for their description. Installing ========== Running "make install" as root installs the files into directories under the prefix passed to configure. If you haven't changed the defaults, then binaries and links will install into /usr/local/bin and manpages into /usr/local/man/man1. Debugging ========= There is a make target for debug versions of the default target which you can build be running "make debug". Alternatively, CFLAGS and STRIP can also be passed directly to make: $ CFLAGS="-DDEBUG -O0" STRIP= make --------------------------------------------------------------------------- Configure ========= What follows are generic installation intructions from autoconf. The text is Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. It is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. cdtool-2.1.8/CHANGES0000644000000000000000000002175510466315122012511 0ustar rootrootCHANGES 2.1.8 RELEASE ---------------------------------------------------- Max Vozeler o Remove the outdated .spec file o Release otherwise unchanged 2.1.8pre4 as 2.1.8 CHANGES 2.1.8pre4 RELEASE ------------------------------------------------- Max Vozeler o Make commands.c ignore CDROM_AUDIO_INVALID status to make it work again with drives like the Toshiba SD-M1612. Thanks to Dani Marti for the bug report. CHANGES 2.1.8pre3 RELEASE ------------------------------------------------- Arnaud Patard o Fix the playing range Max Vozeler o Re-add the missing newline in cdinfo o Update address of the FSF in GPL copyright notices CHANGES 2.1.8pre2 RELEASE ------------------------------------------------- Kevin Ryde o Correct man page .IP typos Max Vozeler o Don't try detection if the user choice fails o cdctrl: Use device from first argument o Included GPL notices in the source files o Relicensed cdown.c under the GPL with Byron's permission. CHANGES 2.1.8pre1 RELEASE ------------------------------------------------ Bruce M. Simpson o Patch to add support for Solaris 2.5 Max Vozeler o Removed some unused tests from configure.ac o Adapt Bruce's patch to autoconf, compile-tested on Solaris 2.9 CHANGES 2.1.7 RELEASE ---------------------------------------------------- Peter Samuelson o Add cdtool2cddb to convert .cdtooldb to CDDB files o Add manpage cdtool2cddb.1 Max Vozeler o Fix the install target o Clarify copyrights in README o Update README and INSTALL CHANGES 2.1.6 RELEASE ---------------------------------------------------- Roland Rosenfeld o Add manpage cdloop.1 Andrea Fanfani o Fix potential /tmp exploit in cdshuffle Peter Samuelson o Patch reintroducing cdvolume. o Patch adding -r for raw CDDB output to cdown. o Disable broken /etc/mtab check. The error message is just as informative. o Patch to improve linefeed handling. o Fix uninitialized buffer in cdir database code. Josh Buhl o Add cdclose command to close the CDROM tray. Martin Mitchell o Change all CD device opens to nonblocking. Mike Coleman o Patch to handle mixed audio and data CDs correctly. Gergely Nagy o Changed cdown.c and cdown.1 to default to freedb.freedb.org o Applied patch from #53347 to remove spurios whitespace from cdown o Appiled patch from #82977 to improve error reporting when cdtool is unable to access the CD-ROM drive Ingo Wilken o Patch to commands.c for Plextor SCSI drives. Jakob Bratkovic o Patch to fix playing the last track Richard Kettlewell o Improve error messages when the cdrom device can't be opened Max Vozeler o New build system o Initial Autotoolizing o cdloop: o Uses $CDTOOLDEV now o cdtool/cdown/cdctrl/cdloop: o Add automatic detection of known CDROM devices o Add -D argument for runtime debugging o cdadd: o Ask before committing data to ~/.cdtooldb o Use favourite $EDITOR with sensible fallback o Fix crash in cdshuffle when no CD is inserted o Check for sane number (<= MAX_TRACKS) of tracks in the TOC header. Fixes strange SIGSEGV on Debian/Sparc. o Document 2.2.17/2.2.18 audio CD kernel bugs o Code fixes o Rename main.[ch] to cdtool.[ch] o Rename s/cdfile/cdfd/g in many places o Replace vasprintf() with vsnprintf() o Remove ifdef CDCTRL o Remove EXIT() o Remove global variables, introduce cdtool_t o Replace DoCr() with newline handling in INFOMSG()/ERRORMSG()/.. o Add strerror to some error fprintf arguments o Fix gcc 3.3 compiler warnings o Fix some typos CHANGES SINCE 2.1.5 BETA RELEASE ----------------------------------------- (1) CDTOOLDBPATH environment variable supported. (2) Bug in resuming from pause fixed. (3) Templates printed with -t option now are "filled out" if the current disc is listed in a database. (4) Make file creates links for manual pages during installation. (5) Code completely reorganized, getopt() used, etc. (6) Support for SunOS? If you have gcc, this should compile and run fine under SunOS 4.1.*, but I don't have the facilities to test it. If you get it working, please let me know. (7) CDTOOLDEV environment variable overrides default path to device. Changes (1) - (4) by suggestion of Fred Baumgarten. Thanks! CHANGES SINCE 2.1.4 RELEASE ---------------------------------------------- (1) Thomas Insel's address is tinsel@tinsel.org. An alternate mirror is at http://www.tinsel.org/files. (2) Some SCSI CD-ROMs do not properly start playing with cdplay. The disc detection code has been cleaned up (but still needs some work). (3) "cdplay" changed to "cdstart" to remove conflict with the cdplay from the cdp package. To restore the previous cdplay, comment out the LINKS line in Makefile and uncomment out the other one.... (4) Made option to make an RPM (make rpm). (5) Added some code documentation. Removed some warnings when building with "make debug". (6) Added "-p command" to cdtool for debugging (e.g., "cdtool -p info" is the same as "cdinfo"). (7) Shuffle mode added (written by Dan Risacher). (8) Bug running cdir without a database fixed. (9) Bug causing database lookup to fail fixed (10) Added -8 and -9, since my CD-R shows up as /dev/scd8. (11) Makefile changes to be more friendly to SCSI users and to properly make cdadd (missing from make all, make scsi, make scsidebug). (12) Added ability to shuffle play 1..100 tracks 1..N times with the -T and -R options. To play a single track at random, use: cdshuffle -R 1 -T 1 (13) cdctrl shuffle option only plays 1 track, at random (like -R 1 -T 1). (14) cdown added (written by Byron Ellacott with mods by W. Hampton). This queries the CDDB database on the Internet and results in output sutiable for inclusion in the user's CDROM database (for cdir, cdinfo, etc.). (15) Many fixes to hardware.c to properly recognize the state of the CDROM, including code from XPlaycd (code which was originally from WorkMan or WorkBone). (16) cdshuffle writes a PID file in /tmp/cdshuffle_N (N=CDROM #). Sending a SIGHUP will cause cdshuffle to skip to the next song. Sending a SIGINT will cause cdshuffle to stop playing, remove its PID file, and exit. (17) cdstop looks for a cdshuffle PID file for this CDROM and if present sends the cdshuffle a SIGINT to tell it to exit and cleanup. (18) Several functions were changed to have cddevice an argument, and to not use the global cd_device per recommendation of Lin. (19) cdctrl sometimes would cause segmentation violations due to cd_device not being global. Hacked, but cd_device should be made local and passed where needed (or better yet, pass a pointer to a CD control struture with {device name, device #, file des, debug fd, verbose flag, CRLF flag, etc.}). Thanks Lin for reporting this.... Most changes 2.0 -> 2.1 were done by Wade Hampton. 2.1.4-2.1.5 changes #7-11 by Daniel Risacher (magnus@mit.edu). Change 14 was by Byron Ellacott. Addition of a PID file and additonal cleanup by Lin Zhe Min. CHANGES SINCE 2.1.2 RELEASE ---------------------------------------------- (1) Fixed cdctrl to do a fflush after each command. May now be started via inetd for remote CD-ROM control. (2) Fixed makefile so "all" is the default make rule. CHANGES SINCE 2.1.1 RELEASE ---------------------------------------------- (1) Fixed cdctrl eject command causing a segmentation violation. (2) Fixed makefile debug option to not strip symbols. (3) Added command.h. (4) Fixed "read_hw" to always return a buffer, more robust. CHANGES SINCE 2.0 RELEASE ---------------------------------------------- (1) SCSI build option added. This uses the CDROMPLAYMSF ioctl instead of the sometimes, not-supported CDROMPLAYTRKIND ioctl call (change to commands.c:do_play()). (2) Makefile includes "scsi", "debug", and "debugscsi" options. (3) Added new program, cdreset. This resets the CDROM drive. (4) Additional documentation. (5) Additional range checks, more robust. (6) Modules hardware.c, info.c, and commands.c now designed for multiple calls. (7) New program, cdctrl added. May be used as a CDROM daemon. (8) New features added (see man page). (9) Manual page updated and manual page for cdctrl written. All changes 1.0 -> 2.0 were done by Sven Oliver Moll CHANGES SINCE 1.0 RELEASE ---------------------------------------------- (1) Bug in Play From-Track-To-Track fixed. (2) cdinfo command added. (3) Code again reorganized. (4) Skip track option in cdplay added. (5) Multiple cdrom device support added. cdtool-2.1.8/COPYING0000644000000000000000000004310510324773577012561 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. cdtool-2.1.8/cdown.10000644000000000000000000000356210200453057012702 0ustar rootroot.TH CDOWN 1 29-July-2004 CDTOOL "User Commands" .\" manual page copyright 1994 thomas insel .\" copyright 1998 Wade Hampton and Byron Ellacott .SH NAME cdown \- query cddb database for info on a disc .SH SYNOPSIS .nf \fBcdown\fR \fBcdown\fR [-[0..9]|-d device] [-H H] [-P P] [-V|-?|-h] .fi .SH DESCRIPTION The .I cdown command is a command to query the CD-ROM for track information, use this to fetch information on this CD-ROM from the CDDB databases (freedb.freedb.org), and then output the information in a form suitable for cdir(1). .I cdown prints the information it downloads on stdout, in a format suitable for appending to .cdtooldb. Should there be an uncertainty as to which CD-ROM information it should download, it prints a list of alternatives to stderr and prompts for the user to select one. A network connection is required for this to operate properly. .SH OPTIONS .RS .IP "\fB-d device\fR" specify the cdrom device .IP "\fB-H host\fR" get database using HOST (def=freedb.freedb.org) .IP "\fB-P port\fR" get database using PORT (def=888) .IP \fB-l\fR list available cddb hosts .IP \fB-[1..9]\fR specify /dev/cdromN (def=/dev/cdrom) .IP \fB-r\fR output raw answer of the CDDB server .IP \fB-v\fR verbose output .IP \fB-D\fR enable runtime debugging .IP \fB-V\fR print version, exit .IP \fB-[?|h]\fR print help, exit .RE .SH FILES .B ~/.cdtooldb - default database file. .SH ENVIRONMENT .B CDTOOLDBPATH - colon delimited path of database files to search. It is not necessary to specify .BR ~/.cdtooldb , as this is automatically added to the end of the search path. .PP .B CDTOOLDEV - device file for cd-rom, overrides compile-time defaults. .B CDDBHOST - host to query, overrides compile-time default .SH SEE ALSO cdir(1) .SH AUTHORS .nf Main code: .RS Bryon Ellacott .RE Enhancements: .RS Wade Hampton .RE .fi cdtool-2.1.8/cdtool.h0000644000000000000000000000114310275456731013152 0ustar rootroot/* cdtool.h */ #ifndef _CDTOOL_H #define _CDTOOL_H #include "hardware.h" /* commands for skiping in playback mode */ #define SKIPBACK -1 #define SKIPFORWARD -2 #define SKIPSTART -3 /* commands to the do_info command */ #define I_TRACK 0x01 #define I_AUDIOSTATUS 0x02 #define I_DISP_REL 0x03 #define I_DISP_ABS 0x04 #define I_DISP_ALL 0x05 /* commands for do_dir: * do_dir (program_name, cd_file, p_format, usedb, cd_device); */ #define P_QUICK 0x01 #define P_LONG 0x02 #define P_TEMPL 0x03 #define P_RAW 0x04 typedef struct cdtool { int fd; char *device; cdhw_t *hw; } cdtool_t; #endif cdtool-2.1.8/cdctrl.10000644000000000000000000000451610102704465013046 0ustar rootroot.TH CDCTRL 1 29-July-2004 CDTOOL "User Commands" .\" manual page Copyright 1998, Wade Hampton .SH NAME cdctrl \- command line CDROM control .SH SYNOPSIS .nf \fBcdctrl\fR [device] \fBcdctrl\fR -c [device] \fBcdctrl\fR -c \fBcdctrl\fR [-V|-?|-h] .fi .SH DESCRIPTION .I cdctrl command is a program that opens a CDROM device and may be used for interactive control of the CDROM including play starting at a track, next track, previous track, stop, pause, display info, display CDROM status, and display CDROM directory. This program may be used as a daemon to control an audio CDROM device. .PP The commands to the .I cdctrl command are: .RS .IP \fBdevice\fR Open CDROM device. .IP \fB-V\fR Print out version and build information. .IP \fB-h\fR Display help. .IP \fB-v\fR Display help. .IP \fB-D\fR Enable runtime debugging. .IP \fB-c\fR Output CR-LF at end of each line, not LF. .RE .PP By default, .I cdctrl opens \fI/dev/cdrom\fR, but does not start playing. Output is to standard output with each line terminated by a linefeed (LF). .PP Commands to .I cdctrl are: .RS .IP \fB1\fR Play first track, start playing. .IP \fBs\fR Stop playing. .IP \fBp\fR Pause playing. .IP \fBr\fR Resume playing. .IP \fBe\fR Eject CDROM. .IP \fBc\fR Close CDROM tray. .IP \fBi\fR Display info string. .IP \fBd\fR Display directory. .IP \fB-\fR Play previous track. .IP \fB+\fR Play next track. When on last track, play first track. .IP \fB[1..99]\fR Play track \fB1..99\fR. .IP \fB?\fR Display help screen. .IP \fBq\fR Quit. .RE .PP Each command results in one or multiple lines of output to \fIstdout\fR, followed by an \fIinfo\fR string, followed by \fIEND\fR. .PP The format of the info string is: \fICMD cmd-name cd-status track abs-time rel-time\fR cmd-name := {play, stop, ... quit} from above list cd-status := {invalid, play, paused} cd-status += {completed, error, no_status} track := {1..99} CD track abs-time := HH:MM:SS elapsed since CD start rel-time := HH:MM:SS elapsed since track start .PP .SH FILES .B /dev/cdrom - default cdrom device .SH ENVIRONMENT .B CDTOOLDEV - cdrom device, overrides compile time defaults .PP .SH SEE ALSO cdplay(1) .SH AUTHORS .nf Main code: .RS Thomas Insel .RE Enhancements: .RS Sven Oliver Moll .RE cdctrl extensions: .RS Wade Hampton .RE .fi cdtool-2.1.8/info.c0000644000000000000000000002223210324773577012623 0ustar rootroot/* info.c * * Copyright 1994 thomas insel * Copyright 1995 sven oliver moll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 dated June, 1991. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include "config.h" #include "cdtool.h" #include "database.h" #include "hardware.h" #include "info.h" #include "util.h" char caBuff[(BUFSIZ > (20 + 8*100)) ? BUFSIZ : (20 + 8*100)]; /************************************************************************/ /* Procedure: tracks_line * Purpose: to display a line of info on a CD-ROM track * * Inputs: hardware info * Outputs: to temp string * Returns: pointer to temp string * Notes: * 1. */ /************************************************************************/ char * tracks_line(cdhw_t *hw) { int i; char *tempstr; size_t len; len = 20 + 8 * (hw->tochdr.cdth_trk1 - hw->tochdr.cdth_trk0); if ((tempstr = malloc(len)) == NULL) return NULL; sprintf(tempstr, "tracks %u ", hw->tochdr.cdth_trk1); for (i=hw->tochdr.cdth_trk0; i<=hw->tochdr.cdth_trk1; i++) sprintf(tempstr + strlen(tempstr), "%u ", hw->tocentries[i-1].cdte_addr.msf.minute*4500 + hw->tocentries[i-1].cdte_addr.msf.second*75 + hw->tocentries[i-1].cdte_addr.msf.frame ); sprintf(tempstr + strlen(tempstr), "%u", hw->tocentries[hw->tochdr.cdth_trk1].cdte_addr.msf.minute*60 + hw->tocentries[hw->tochdr.cdth_trk1].cdte_addr.msf.second); return tempstr; } /************************************************************************/ /* Procedure: do_info * Purpose: to print info on a CD-ROM * * Inputs: name of program, cd file descriptior, info level, CR flag, * device of CDROM * Outputs: to stdout/stderr * Returns: n/a * Notes: * 1. */ /************************************************************************/ void do_info(cdtool_t *cdtool, int info) { cdhw_t *hw = cdtool->hw; debugmsg("do_info: called, info=%d, hw=%lx", info, (long)hw); if (!check_disc (hw)) { infomsg("%s", cd_status_text(hw->iStatus)); return; } /* audio status */ if ((info == I_AUDIOSTATUS) || (info == I_DISP_ALL)) { switch (hw->subchnl.cdsc_audiostatus) { case CDROM_AUDIO_INVALID: printf("invalid "); break; case CDROM_AUDIO_PLAY: printf("play "); break; case CDROM_AUDIO_PAUSED: printf("paused "); break; case CDROM_AUDIO_COMPLETED: printf("completed "); break; case CDROM_AUDIO_ERROR: printf("error "); break; case CDROM_AUDIO_NO_STATUS: printf("no-status "); break; default: printf("unknown%d ", hw->subchnl.cdsc_audiostatus); break; } } /* track info */ if ((info == I_TRACK) || (info == I_DISP_ALL)) { printf("%u ",((hw->subchnl.cdsc_audiostatus == CDROM_AUDIO_PLAY) || (hw->subchnl.cdsc_audiostatus == CDROM_AUDIO_PAUSED)) ? hw->subchnl.cdsc_trk : 0); } /* absolute time, i.e., since CD start */ if ((info == I_DISP_ABS) || (info == I_DISP_ALL)) { printf("%2u:%02u.%02u ", hw->subchnl.cdsc_absaddr.msf.minute, hw->subchnl.cdsc_absaddr.msf.second, hw->subchnl.cdsc_absaddr.msf.frame); } /* relative time, i.e., since track start */ if ((info == I_DISP_REL) || (info == I_DISP_ALL)) { printf("%2u:%02u.%02u ", hw->subchnl.cdsc_reladdr.msf.minute, hw->subchnl.cdsc_reladdr.msf.second, hw->subchnl.cdsc_reladdr.msf.frame); } debugmsg("do_info: finished"); } /************************************************************************/ /* Procedure: do_dir * Purpose: to print the directory of a CD-ROM * * Inputs: prog name, format info, database, CR flag, * device of CDROm * Outputs: to stdout/stderr * Returns: n/a * Notes: * 1. */ /************************************************************************/ void do_dir(cdtool_t *cdtool, int p_format, int usedb) { cdhw_t *hw; char *tracks_buffer; cd_t *cd; int i; /* generic index variable */ struct cdrom_msf *curmsf; struct cdrom_msf *prevmsf; struct cdrom_tocentry *tocentry; int delfrms; hw = cdtool->hw; debugmsg("do_dir: called, pfmt=%d, usedb=%d", p_format, usedb); if (!check_disc (hw)) { if (hw->iStatus != CD_STATUS_DATA_DISC) { errormsg("%P: %s", cd_status_text(hw->iStatus)); return; } } tracks_buffer = tracks_line(hw); cd = read_db(tracks_buffer, usedb); /* print name & artist info */ if (p_format == P_TEMPL) { infomsg("%s", tracks_buffer); infomsg("cdname %s", cd->cdname); infomsg("artist %s", cd->artist); } if (p_format == P_LONG || p_format == P_QUICK) { printf("%s", cd->artist); if (cd->cdname[0] && cd->artist[0]) printf(" - "); printf("%s", cd->cdname); if (!cd->artist[0] && !cd->cdname[0]) printf("unknown cd"); if (p_format == P_LONG) { tocentry = &hw->tocentries[hw->tochdr.cdth_trk1]; printf(" - %2u:%02u in %u tracks", tocentry->cdte_addr.msf.minute, tocentry->cdte_addr.msf.second, hw->tochdr.cdth_trk1); } do_crlf(stdout); } /* print tracks */ switch (p_format) { case P_RAW: printf("%2u-%2u",hw->tochdr.cdth_trk0, hw->tochdr.cdth_trk1); do_crlf(stdout); for (i = hw->tochdr.cdth_trk0; i <= hw->tochdr.cdth_trk1+1; i++) { tocentry = &hw->tocentries[i-1]; printf("%2X %02u:%02u.%02u %c", (i < hw->tochdr.cdth_trk1+1) ? ((i/10)*16+i%10) : 0xaa, tocentry->cdte_addr.msf.minute, tocentry->cdte_addr.msf.second, tocentry->cdte_addr.msf.frame, (tocentry->cdte_ctrl == CDROM_DATA_TRACK) ? 'D' : 'A'); do_crlf(stdout); } break; case P_LONG: for (i = hw->tochdr.cdth_trk0; i <= hw->tochdr.cdth_trk1; i++) { prevmsf = (struct cdrom_msf *) &hw->tocentries[i-1].cdte_addr.msf; curmsf = (struct cdrom_msf *) &hw->tocentries[i].cdte_addr.msf; delfrms = (curmsf->cdmsf_min0 - prevmsf->cdmsf_min0) * 4500; delfrms += (curmsf->cdmsf_sec0 - prevmsf->cdmsf_sec0) * 75; delfrms += (curmsf->cdmsf_frame0 - prevmsf->cdmsf_frame0); printf(" %2u:%02u.%02u %2u ", delfrms / 4500, (delfrms % 4500) / 75, delfrms % 75, i); if (hw->tocentries[i-1].cdte_ctrl == CDROM_DATA_TRACK) printf("[DATA] "); if (i == hw->subchnl.cdsc_trk) { if (hw->subchnl.cdsc_audiostatus == CDROM_AUDIO_PLAY) printf("[PLAYING] "); else if (hw->subchnl.cdsc_audiostatus == CDROM_AUDIO_PAUSED) printf("[PAUSED] "); } if (usedb) printf("%s",cd->track_names[i-1]); do_crlf(stdout); } break; /* P_LONG */ case P_QUICK: switch (hw->subchnl.cdsc_audiostatus) { case CDROM_AUDIO_PLAY: printf(" - "); if (cd->track_names[hw->subchnl.cdsc_trk-1][0]) printf("%s ", cd->track_names[hw->subchnl.cdsc_trk-1]); printf("[%u]", hw->subchnl.cdsc_trk); do_crlf(stdout); break; case CDROM_AUDIO_PAUSED: printf(" - paused on "); if (cd->track_names[hw->subchnl.cdsc_trk-1][0]) printf("%s ", cd->track_names[hw->subchnl.cdsc_trk-1]); printf("[%u]", hw->subchnl.cdsc_trk); do_crlf(stdout); break; } break; /* P_QUICK */ case P_TEMPL: for (i = hw->tochdr.cdth_trk0; i<=hw->tochdr.cdth_trk1; i++) infomsg("track %s", cd->track_names[i-1]); break; } free(tracks_buffer); } cdtool-2.1.8/database.c0000644000000000000000000000770510324773577013444 0ustar rootroot/* database.c * * Copyright 1994 thomas insel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 dated June, 1991. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include "config.h" #include "database.h" #include "util.h" /* chomp(): conceptually similar to the Perl function of that name. * Removes any number of CR or NL chars from the end of a string. */ static char *chomp(char *c) { int l=strlen(c)-1; while (l>=0 && (c[l]=='\n' || c[l]=='\r')) c[l--]='\0'; return c; } /************************************************************************/ /* Procedure: read_db * Purpose: to read database info for this CD-ROM * * Inputs: tracks info, database * Outputs: to cd_t * Returns: pointer to cd_t structure * Notes: * 1. */ /************************************************************************/ cd_t * read_db(char *tracks_buffer, char usedb) { /* given "tracks" line in tracks_buffer, search databases for a * corresponding entry, return cdname/artist/tracks information * * if the disc is listed more than once, this routine will return * the last entry for the disc from the first file that has any * entry for it. */ char *path_env = getenv("CDTOOLDBPATH"); char *path_bit; int dbpath_count=1, cur_file=0, found_it=0; struct passwd *prec = getpwuid(getuid()); cd_t *temp_cd = (cd_t *)calloc(1,sizeof(cd_t)); char dbpath[10][255]; if (!usedb) { /* free ((void *)temp_cd); * can't free this, we're returning it */ return temp_cd; } /* first, put default file in search path */ strcpy(dbpath[0], prec->pw_dir); strcat(dbpath[0], "/.cdtooldb"); /* read search path from environment */ if (path_env != NULL) while (dbpath_count < 9 && (path_bit = strsep(&path_env, ":\0")) != NULL) strcpy(dbpath[dbpath_count++], path_bit); /* check files in search path until the disc's entry is found */ while (!found_it && cur_file < dbpath_count) { char read_buffer[2048]; int cur_track=0, printing=0; FILE *fred = fopen(dbpath[cur_file], "r"); cur_file++; while (fred != NULL && !feof(fred) ) { fgets(read_buffer, 2048, fred); if (strncmp(read_buffer, tracks_buffer, strlen(tracks_buffer)) == 0) { printing = 1; found_it = 1; } else if (strncmp(read_buffer, "tracks ", 7) == 0) { printing = 0; } else if (printing) { if (strncmp(read_buffer,"track ",6) == 0) strncpy(temp_cd->track_names[cur_track++], &read_buffer[6],99); else if (strncmp(read_buffer,"cdname ",7) == 0) strncpy(temp_cd->cdname, &read_buffer[7],99); else if (strncmp(read_buffer,"artist ",7) == 0) strncpy(temp_cd->artist, &read_buffer[7],99); } } if (fred) { fclose(fred); chomp(temp_cd->cdname); chomp(temp_cd->artist); while(cur_track--) chomp(temp_cd->track_names[cur_track]); } else { int i; temp_cd->cdname[0] = '\0'; temp_cd->artist[0] = '\0'; for (i=0 ; i<100 ; i++ ) temp_cd->track_names[i][0] = '\0'; } } /*while*/ return temp_cd; } cdtool-2.1.8/cdloop.10000644000000000000000000000300610324773577013064 0ustar rootroot.\" cdloop - restart a CD when it ceases playing .\" Copyright (c) 1999 Roland Rosenfeld .\" .\" This manual page is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software Foundation, .\" Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA .\" .\" This manual page is written especially for Debian Linux. .\" .TH CDLOOP 1 29-July-2004 "Debian Project" "Debian GNU/Linux" .SH NAME cdloop \- Restart a CD when it ceases playing .SH SYNOPSIS .B cdloop .I [v] [1] .SH DESCRIPTION .B cdloop is a tiny shell script for endless looping an audio CD using .BR cdplay (1). .SH OPTIONS .IP v Print verbose output on screen. .IP 1 Use second CDROM drive. .SH ENVIRONMENT .B CDTOOLDEV \- if set, .B cdloop uses this cdrom device. .SH AUTHOR .B cdloop was written by M. M. Eccles. .PP This manual page was created by Roland Rosenfeld for the Debian GNU/Linux system (but may be used by others). .SH "SEE ALSO" .BR cdplay (1). cdtool-2.1.8/info.h0000644000000000000000000000415310222337602012610 0ustar rootroot#ifndef __INFO_H__ #define __INFO_H__ /************************************************************************/ /* * Header: INFO * Purpose: to define the interface to the INFO module * Language/Compiler/O/S: GCC 2.7.2 * Author: Wade Hampton * Date: 12/22/97 * Revision History: * [from RCS] * * $Log: info.h,v $ * Revision 1.4 1998/07/15 13:53:36 wadeh * prior to Lin's changes * * Revision 1.3 1998/01/06 21:00:33 wadeh * Added DoCr, changes to fix cdeject crash. * * Revision 1.2 1997/12/23 22:52:51 wadeh * 2.1 beta 1 release * * Revision 1.1 1997/12/23 21:39:39 wadeh * Initial revision * * * Notes: * 1) *----------------------------------------------------------------------*/ /* TYPES- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* INCLUDE FILES- - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #include "cdtool.h" /* CONSTANTS- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* commands to the do_info command */ #define I_TRACK 0x01 #define I_AUDIOSTATUS 0x02 #define I_DISP_REL 0x03 #define I_DISP_ABS 0x04 #define I_DISP_ALL 0x05 /* commands to the do_dir command */ #define P_QUICK 0x01 #define P_LONG 0x02 #define P_TEMPL 0x03 #define P_RAW 0x04 /* LOCAL DATA - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* EXTERNAL PROCEDURES- - - - - - - - - - - - - - - - - - - - - - - - - */ /* EXTERNAL DATA- - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* PROTOTYPES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* DO_INFO: Display info about CD-ROM to stdout */ void do_info( cdtool_t *cdtool, /* cdtool handle */ int info /* INFO command, I_* above */ ); /* DO_DIR: Display info on the CD-ROM (reads optional database) */ void do_dir ( cdtool_t *cdtool, /* name of progarm */ int p_format, /* command, P_* above */ int usedb /* T/F, if T, try to read the database (text)*/ ); /* * Copyright (C) 1997, 1998 Wade Hampton */ /************************************************************************/ #endif cdtool-2.1.8/cdtool.10000644000000000000000000001024110102704527013046 0ustar rootroot.TH CDTOOL 1 29-July-2004 CDTOOL "User Commands" .\" manual page copyright 1994 thomas insel .\" copyright 1995,96 sven oliver moll .\" copyright 1997, 1998 Wade Hampton and Dan Risacher .SH NAME cdtool \- play and catalog audio CDROMs on CDROM drive(s) .SH SYNOPSIS .nf \fBcdeject\fR [-[0..9]|-d device] [-V|-?|-h] \fBcdclose\fR [-[0..9]|-d device] [-V|-?|-h] \fBcdir\fR -n [-[0..9]|-d device] [-r|-s|-t|-V|-?|-h] \fBcdinfo\fR [-[0..9]|-d device] [-a|-r|-s|-t|-v|-V|-?|-h] \fBcdpause\fR [-[0..9]|-d device] [-V|-?|-h] \fBcdplay\fR [-[0..9]|-d device] [\fIstart\fR [\fIstop\fR] \fBcdplay\fR [-[0..9]|-d device] [\fI+|-\fR \fInumber\fR] \fBcdplay\fR [-[0..9]|-d device] [start|stop|resume|eject|close|info|dir] \fBcdplay\fR [-[0..9]|-d device] [-V|-?|-h] \fBcdstop\fR [-[0..9]|-d device] [-V|-?|-h] \fBcdvolume\fR [-[0..9]|-d device] [-V|-?|-h|\fIlevel\fR] \fBcdshuffle\fR [-[0..9]|-d device] [-V|-?|-h] .fi .SH DESCRIPTION The .I cdeject command ejects the current compact disc. .PP The .I cdclose command closes the CDROM tray. .PP The .I cdir command lists information about the currently loaded audio compact disc. In particular, it lists the lengths of all tracks. It also references the database files specified in the .B CDTOOLPATHDB environment variable and the .B ~/.cdtooldb file, which use a simplified version of the format used by .IR workman(1). If one of these files contains an entry for the current compact disc, .I cdir will print title, artist, and track name information. .RS .IP \fB-n\fR Do not lookup any information in the database files. .IP \fB-s\fR Print information in a short format: only author, title, and current track, all on one line. .IP \fB-t\fR Print a template for the current cd, including title, artist, and track name information if available. If blank lines are filled in, this can be appended to the .B ~/.cdtooldb file. .RE .PP The .I cdinfo command, with no option used, will print out the audiostatus (playing, etc.). .RS .IP \fB-a\fR Print out the absolute disc time. .IP \fB-r\fR Print out the relative track time. .IP \fB-s\fR Print out the audiostatus. .IP \fB-t\fR Print out the current track. .IP \fB-v\fR All info: \fBstatus track absolute relative\fR. .RE .PP The .I cdpause command pauses the currently playing compact disc. Resume by using .I cdplay with no arguments. .PP The .I cdplay command plays the compact disc. If called with one argument, this is the starting track number. If called with two arguments, these are the starting and stopping track numbers. If the first argument is a .B + or .B - then skip the number of tracks given by the second argument forward or backward. If no second argument is give, skip one. A .B 0 as first argument or no argument replays current track. .PP The .I cdstop command stops the compact disc, if it is playing. .PP The .I cdvolume command sets the output volume level of the CD player. The level is an integer from 0 to 255. .PP The .I cdshuffle command plays the audio tracks on the disc in random order. .PP The default device opened is \fB/dev/cdrom\fR. This default and others may be changed in \fIconfig.h\fR. Options supported by all programs are: .RS .IP "\fB-[0..7]\fR" Multiple cdrom support to open \fB/dev/scd0../dev/scd7\fR [by default]. .IP "\fB-d device\fR" Multiple cdrom support to open \fBdevice\fR by name. .IP "\fB[-h|-?]\fR" Print out help for the command. .IP "\fB-V\fR" Print out version information and build information. .IP "\fB-D\fR" Enable runtime debugging. .RE .SH FILES .B ~/.cdtooldb - default database file. .SH ENVIRONMENT .B CDTOOLDBPATH - colon delimited path of database files to search. It is not necessary to specify .BR ~/.cdtooldb , as this is automatically added to the end of the search path. .PP .B CDTOOLDEV - device file for cd-rom, overrides compile-time defaults. .SH SEE ALSO cdctrl(1), cdadd(1), cdown(1) .SH AUTHORS .nf Main code: .RS Thomas Insel .RE Enhancements: .RS Byron Ellacott Wade Hampton Lin Zhe Min Sven Oliver Moll Daniel R. Risacher Max Vozeler .RE .fi cdtool-2.1.8/TODO0000644000000000000000000000164710243277610012206 0ustar rootrootSTILL TO BE DONE ------------------------------------------------------- o why does CDROMSTART somtimes prevent CDROMPLAYMSF from working? o finish autotoolizing o RPM .spec is outdated/broken? o List the available CD-ROM devices somehow o Combine common code like getopt() handling o Add CDDB submit support o Check with "Guidelines for optimal freedb support" at http://www.freedb.org/modules.php?name=Sections&sop=viewarticle&artid=38 o Change cdtool to use a CDDB backend. Ideally data from both formats would be merged at runtime. Maybe it can also be shared with other CDDB aware programs like gnome-cd? o Nice interface for editing the database files. o Fast forward, Rewind. o Code cleanup and documentation. BUGS ------------------------------------------------------------------ o Find work-around for the resume bugs of some drives (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=34242) cdtool-2.1.8/cdtool2cddb.10000644000000000000000000000370010104176604013750 0ustar rootroot.TH CDTOOL2CDDB "1" "10 December 2000" "CDTOOL" "User Commands" .\" .\" Copyright abandoned, 2000, Peter Samuelson .\" .SH NAME cdtool2cddb \- convert .cdtooldb file to set of CDDB files .SH SYNOPSIS .B cdtool2cddb [\fB\-rvx\fR] [\fB\-d\fR \fIdir\fR] [\fB\-l\fR \fIlen\fR] [\fIinput\fR...] .SH DESCRIPTION .I cdtool2cddb converts one or more .B \.cdtooldb files to .BR CDDB \-format files suitable for using with many CD player applications. The output is a set of files, each named for the 32-bit hexadecimal CDDB ID number of a given audio CD. These files are placed in the current directory unless .I \-d is specified. .SH OPTIONS .TP .BI -d " directory" Specify the output directory. This is where the 8-digit output filenames go. There will be one file for each CD definition in your .B \.cdtooldb file(s). .TP .BI \-l " length" Specify the maximum line length for the output file. Comment lines may be any length, but the .I CDDB format specifies that data lines must wrap at 76 characters. Thus, this is the default for .IR cdtool2cddb , but you may change it if you wish. .TP .B \-r At least one CD player application .RI ( groovycd ) requires lines of its .I CDDB files to end with CR-LF, because they come over the network that way. The .B \-r option tells .I cdtool2cddb to output such lines; otherwise lines will end with LF only. .TP .B \-v Increment the verbosity level. .TP .B \-x Use an alternate identification string in the output file. If you wish to upload a .I CDDB file to a .I CDDB server via e-mail, the server will probably check the ID string in the file to make sure it is from a "trusted" CD player application. .I cdtool is not trusted, but .I xmcd is, so the .B \-x option pretends we are .IR xmcd \. .RE .SH FILES .TP .B ~/.cdtooldb A typical cdtooldb input file .TP .BR /var/lib/cddb/misc ", " ~/.groovycd Typical output directories (see .BR \-d ). .SH SEE ALSO cdir(1), cdown(1), cdadd(1) .SH AUTHOR Peter Samuelson cdtool-2.1.8/database.h0000644000000000000000000000025010074600363013415 0ustar rootroot/* database.h */ typedef struct { char track_names[100][100]; char cdname[100]; char artist[100]; } cd_t; cd_t *read_db(char *tracks_buffer, char usedb); cdtool-2.1.8/README0000644000000000000000000002203510466315122012366 0ustar rootrootCDTOOL 2.1.8, 2006-08-09, Max Vozeler ============================================================= CDTOOL is a free software package to control the audio functions of an attached CDROM drive from the command line in a quick and and scriptable way. CDTOOL consists of several programs. Actually, most of them are really one program that can be called with multiple different names. These commands are included: cdplay -- play the CDROM or resume from pause. cdstart -- alternate name for cdplay (for those with cdp/cdplay). cdpause -- pause play. cdstop -- stop play. cdeject -- eject the CDROM, if supported. cdclose -- close the CDROM tray, if supported. cdir -- list tracks on the CDROM. cdinfo -- display information on the CDROM. cdreset -- reset the CDROM device (2.1 experimental). cdshuffle -- play the tracks of the CDROM in random order. cdloop -- endless-loop the CD cdctrl -- interactive control of CDROM cdown -- query CDDB database for CD info cdadd -- add to local CD database cdctrl is designed to be used to establish a connection with a CDROM and interactivly control it via standard input. This binary returns status in human- and machine-readable format, hence may be used to remotely control a CDROM, e.g., as a daemon. Note, cdctrl may also be automated via expect, sh, TCL, perl or other scripting language. The cdir command supports a database of artist, title, and track names in a simple format compatible with Workman, a nice OPEN LOOK based program for controlling audio discs in a CDROM drive. It first looks in the user's ~/.cdtooldb file. Then, if the CDTOOLDBPATH environment variable is set to a colon-delimited list of files, cdir will check them in order until it finds the cd. There is a shell script, "cdadd", which automates adding entries to the file a bit, but Workman is better for this. The program cdown may be used to read a CDROM's track info and query the CDDB database on the Internet from freedb.org. CDTOOL doesn't do anything fancy. There is no scan, fast forward, repeat, etc. Maybe these functions are better performed by a full-screen or graphical program, or simply noone has botherd to implemented them yet. CDTOOL is designed to be a simple, elegant command line utility. For more specifics on how to use the program refer to the man page. Note, CDTOOL does include previous and next track access. Download ======== The newest released version of CDTOOL is always available from the below URLs. CDTOOL is also included in the Mandrake, Gentoo and Debian GNU/Linux distributions. http://hinterhof.net/cdtool/dist/ ftp://ftp.ibiblio.org/pub/linux/apps/sound/cdrom/cli/ Installation ============ See the INSTALL file. Mailinglist =========== There is a mailinglist for users and developers of cdtool named cdtool-devel. If you have ideas about how cdtool could improve or what features are missing, have code to contribute or problems using it, or whatever really, feel free to send it along to this list. Post: cdtool-devel@lists.hinterhof.net Subscribe: http://lists.hinterhof.net/mailman/listinfo/cdtool-devel Archive: http://lists.hinterhof.net/pipermail/cdtool-devel/ Known Bugs ========== When play begins on a track, the wrong track may be reported; this happens when the offset returned after the seek is a fraction of a second less than the start time for the track, with the result that the track is one less than it should be. Any subsequent requests for i/cdinfo report the correct track. CDTOOL is known to have problems working with 2.2.16 and 2.2.17 Linux kernels. cdplay exits with the error message "ioctl cdromplaytrkind" and refuses to play CDs. The cause of this was a kernel bug that has been fixed in >= 2.2.18 Linux kernels. SCSI/non-SCSI ============= If CDTOOL doesn't work with your CDROM or controller, there is a slim chance that building the "non-SCSI" version will fix it. (Note: That name is a bit misleading. The default "SCSI" version should actually work with all kinds of non-SCSI drives, too) $ ./configure --disable-scsi Should this code work better for you than the default, please send a quick message with details about your operating system and hardware to the cdtool-devel mailinglist. CDROM device permissions ======================== If you get an access problem with the CDROM device, you need to give yourself permission to read and write to /dev/cdrom* or whatever name your CDROM has. The preferred way of doing this is to make the user(s) member of the cdrom group: # adduser cdrom Don't forget to logout and login again to update group membership of your session. If you are not using a cdrom group to control access to the CDROM, you can simply make the device available to anyone: Eg: # chmod 666 /dev/hdb -- IDE CDROM on /dev/hdb OR # chmod 666 /dev/scd0 -- SCSI CDROM on /dev/scd0 Development =========== CDTOOL development takes place in a public Subversion repository. The latest development version is available in the directory /public/cdtool/trunk/ You can check it out using: $ svn co http://svn.hinterhof.net/public/cdtool cdtool-current The latest Debian version of CDTOOL, which will at some point be going into unstable, is developed in the directory /public/cdtool/trunk-debian Check it out using: $ svn co http://svn.hinterhof.net/public/cdtool/trunk-debian cdtool-debian CDTOOL development is discussed on the cdtool-devel mailinglist. Feel free to send patches, comments, feature requests, bugs and other things related to CDTOOL to this list. CDCTRL (WARNING): ================= If you want to use cdctrl from inetd to have remote control of your CDROM, you can edit /etc/services and /etc/inetd.conf per the instructions below. WARNING: Please note, this code may not be secure and could open up security holes on your system. 1. Add a CDROM to /etc/services with the 9000 being a port that you want to use (any one above 1024): cdrom 9000/tcp # first CDROM drive 2. Add a CDROM controller to /etc/inetd.conf (with anyuser being the name of a user who should run the program, /usr/local/bin/cdctrl being the name of the program to run, and /dev/cdrom being the name of your CDROM): cdrom stream tcp nowait anyuser /usr/sbin/tcpd \ /usr/local/bin/cdctrl /dev/cdrom Copyrights and License ====================== This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The following copyright statements are incremental, that is all copyright statements added together give the copyrights that apply to the most recent version: CDTOOL 1.0 is Copyright 1994 Thomas Insel. It may be distributed freely under the terms of the GPL. For more information, read the files "COPYING" and "main.c". CDTOOL 1.0 contains some code from XPlaycd (mainly in hardware.c) which is by Olav Woelfelschneider. Per the CREDITS file with XPlaycd, this code was originally from WdorkBone and/or WorkMan. Thanks for OpenSource! CDTOOL 2.0 is Copyright 1995,96 Sven Oliver Moll. Since it was GPL, it still is GPL. CDTOOL 2.1 is Copyright 1997,98 Wade Hampton, Dan Risacher, Lin Zhe Min, Byron Ellacott, and the original authors. Since it was GPL, it is still GPL. CDTOOL 2.1.6 is Copyright 2004 Max Vozeler, Copyright 2003 Josh Buhl, Copyright 1999 Roland Rosenfeld, Copyright 1999 Mike Coleman and Copyright 2001 Richard Kettlewell. CDTOOL 2.1.7 is Copyright 2004 Max Vozeler and Copyright 2000 Peter Samuelson. EMAIL: Byron Ellacott Daniel R. Risacher Josh Buhl Lin Zhe Min Max Vozeler Mike Coleman Olav Woelfelschneider Peter Samuelson Richard Kettlewell Roland Rosenfeld Sven Oliver Moll Thomas Insel Wade Hampton See also PEOPLE and CHANGES for detailed attributions. Please let me know if you make any useful modifications, successfully run CDTOOL under an operating system besides Linux, are interested in different licensing terms, find CDTOOL useful, or whatever. Please address all correspondance regarding CDTOOL to tinsel@tinsel.org, whampton@staffnet.com, or to Thomas Insel, 210 Parkview Drive, Bloomington, IL 61701-2038. cdtool-2.1.8/cdadd0000644000000000000000000000204710102217706012465 0ustar rootroot#!/bin/sh # "cdadd" copyright 1994 thomas insel # copyright 1996 sven oliver moll # copyright 2004 Max Vozeler usage() { echo >&2 Usage: `basename $0` [-[0-7]] echo >&2 This program is part of cdtool. See \"man cdtool\" for more info. exit 1 } PATH=/bin:/usr/bin:/usr/local/bin TMPFILE=~/.cdadd-$$ case $# in [01]) ;; *) usage;; esac case x$1 in x-[0-7]) DRIVE=-$1;; x) ;; *) usage;; esac cdir $DRIVE -t > $TMPFILE if test -z $EDITOR; then for favourite in emacs vim vi; do if command -v $favourite >/dev/null 2>&1; then EDITOR=$favourite break fi done fi if test -z $EDITOR; then echo Unable to find an editor. Please set the environment variable echo EDITOR to the location of your preferred editor. Eg: echo echo \$ export EDITOR=/path/to/editor echo \$ cdadd echo exit 1 fi $EDITOR $TMPFILE echo ==== about to add ================= cat $TMPFILE echo -n ==== ok? [Yn] read n; case $n in [nN]) echo aborting. exit 1 ;; esac cat $TMPFILE >>~/.cdtooldb rm $TMPFILE cdtool-2.1.8/config.h.in0000644000000000000000000001002310222554477013533 0ustar rootroot/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #undef GETGROUPS_T /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if your system has a working `getgroups' function. */ #undef HAVE_GETGROUPS /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the `getmntent' function. */ #undef HAVE_GETMNTENT /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the ioctl CDROMCLOSETRAY */ #undef HAVE_IOCTL_CDROMCLOSETRAY /* Define to 1 if you have the ioctl CDROMRESET */ #undef HAVE_IOCTL_CDROMRESET /* Define to 1 if you have the header file. */ #undef HAVE_IOCTL_H /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_CDROM_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_MNTENT_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if you have the header file. */ #undef HAVE_SYS_CDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MNTTAB_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t cdtool-2.1.8/shuffle.c0000644000000000000000000002255210324773577013331 0ustar rootroot/* shuffle.c * * Copyright 1998 daniel risacher * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 dated June, 1991. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "cdtool.h" #include "commands.h" #include "hardware.h" #include "info.h" #include "shuffle.h" #include "util.h" /* globals for this module */ static int iDone = FALSE; static int iNext = FALSE; static int iBEVerbose = FALSE; static char *pszName = NULL; /************************************************************************/ /* Procedure: huphdl * Purpose: handler for SIGHUP * * Inputs: * Outputs: TRUE to iNext flag -- do next track * Returns: * Notes: * 1. Sending a HANGUP (SIGHUP,1) will cause cdshuffle to skip * to the next track. This may be used for debug or just if * you don't like a song. */ /************************************************************************/ void huphdl () { signal (SIGHUP, huphdl); iNext = TRUE; if (iBEVerbose) fprintf (stderr, "%s: Hangup received....\n", pszName); } /************************************************************************/ /* Procedure: inthdl * Purpose: handler for SIGINT * * Inputs: * Outputs: TRUE to iDone flag -- finished with processing * Returns: * Notes: * 1. Sending an INTERRUPT (SIGINT,2) will cause cdshuffle to * stop playing, remove its PID file, and exit. */ /************************************************************************/ void inthdl () { signal (SIGINT, inthdl); iDone = TRUE; if (iBEVerbose) fprintf (stderr, "%s: Interrupt received....\n", pszName); } /************************************************************************/ /* Procedure: wait_track * Purpose: to wait for a track to finish * * Inputs: program name, CD file des., track number * Outputs: none * Returns: pointer to temp string * Notes: * 1. Polls the CD-ROM at a 1 second interval waiting for a * track to finish.... */ /************************************************************************/ int wait_track(int cdfd, int track) { struct cdrom_subchnl subchnl; debugmsg("%P: waiting on track %d", track); while (1) { subchnl.cdsc_format = CDROM_MSF; if (ioctl(cdfd, CDROMSUBCHNL, &subchnl) == -1) { if (errno == EINTR) return TRUE; errormsg("%P: ioctl cdromsubchnl: %s", strerror(errno)); return (-1); } switch ( subchnl.cdsc_audiostatus ) { case CDROM_AUDIO_PAUSED: case CDROM_AUDIO_PLAY: sleep(1); if (iDone == TRUE) { debugmsg("%P: done with audio r=%#x", subchnl.cdsc_audiostatus); return TRUE; } if (iNext == TRUE) { debugmsg("%P: next track processing r=%#x", subchnl.cdsc_audiostatus); iNext = FALSE; return TRUE; } break; case CDROM_AUDIO_COMPLETED: debugmsg("%P: Audio Completed r=%#x", subchnl.cdsc_audiostatus); return TRUE; default: debugmsg("%P: default r=%#x", subchnl.cdsc_audiostatus); return TRUE; } } } /************************************************************************/ /* Procedure: shuffle_lock * Purpose: create pidfile for shuffle ************************************************************************/ int shuffle_lock(int cdnum) { pid_t my_pid = getpid(); char pidfile[PATH_MAX]; struct passwd *pw; FILE *fp; pw = getpwuid(getuid()); if (pw == NULL) { fprintf(stderr, "Username not in passwd database - aborting\n"); exit(1); } snprintf(pidfile, sizeof(pidfile), "%s%s%d", pw->pw_dir, PID_FILE, cdnum); fp = fopen (pidfile, "w"); if (fp == NULL) { errormsg("%P: Error opening pid file %s: %s", pidfile,strerror(errno)); return(-1); } verbosemsg("%P: Writing PID file %s\n", pidfile); fprintf(fp, "%ld\n", (unsigned long) my_pid); fclose (fp); return(0); } /************************************************************************/ /* Procedure: shuffle_unlock * Purpose: remove pidfile and (optionally) kill running cdshuffle ************************************************************************/ int shuffle_unlock(int cdnum, int stop) { pid_t shuffle_pid; char buf[255]; char pidfile[PATH_MAX]; struct passwd *pw; FILE *fp; pw = getpwuid(getuid()); if (pw == NULL) { fprintf(stderr, "Username not in passwd database - aborting\n"); exit(1); } snprintf (pidfile, sizeof(pidfile), "%s%s%d", pw->pw_dir, PID_FILE, cdnum); fp = fopen (pidfile, "r"); if (fp == NULL) { verbosemsg("%s: Error opening pid file %s: %s", "cdshuffle", pidfile, strerror(errno)); return(0); } if (fgets (buf, sizeof(buf), fp) != NULL) { shuffle_pid = atoi (buf); if (stop) kill (shuffle_pid, SIGINT); } fclose (fp); verbosemsg("%s: removing lock file %s\n", "cdshuffle", pidfile); unlink (pidfile); return(0); } /************************************************************************/ /* Procedure: do_shuffle * Purpose: to play a CD-ROM in shuffle mode * * Inputs: program name, CD file descriptor, max tracks to play, * count of tracks, verbose flag (T/F), , CD device, * CR/CRLF flag * Outputs: none * Returns: pointer to temp string * Notes: * 1. Calls wait_track to wait for a track to finish playing.... * 2. This function should be modified for the following: * A) Additon of a count of times to shuffle and max tracks to play. * B) Change to call read_hw() as read_hw() includes additional * CD-ROM checks (e.g., if mounted). */ /************************************************************************/ void do_shuffle(cdtool_t *cdt, int iCDNum, int iTracks, int iCount) { struct cdrom_tochdr tochdr; int tracks[100]; int nent_tracks; int i, j, tmp, r; int iSaveTracks; int status; iSaveTracks = iTracks; pszName = getprogname(); iBEVerbose = cdtool_show_verbose; status = 0; debugmsg("%P: do_shuffle: file=%d, num=%d, trk=%d, cnt=%d, V=%d", cdt->fd, iCDNum, iTracks, iCount, cdtool_show_verbose); if (!check_disc(cdt->hw)) { errormsg("%P: can't shuffle (%s)", cd_status_text(cdt->hw->iStatus)); return; } /* get number of tracks, if not available, error... */ if ( ioctl(cdt->fd, CDROMREADTOCHDR, &tochdr) == -1 ) { errormsg("%P: ioctl cdromreadtochdr: %s", strerror(errno)); return; } nent_tracks = tochdr.cdth_trk1; signal (SIGINT, inthdl); signal (SIGHUP, huphdl); /* update the pid file */ shuffle_lock(iCDNum); /* repeat play N time (if N = -1, do forever) */ iDone = FALSE; while (iDone == FALSE) { debugmsg("do_shuf: tracks=%d repeat=%d verbose=%d", iTracks, iCount, cdtool_show_verbose); /* generate random list of tracks to play */ for (i=0; ifd, tracks[i]); /* if we have played the desired # of tracks, DONE */ iTracks--; if (iTracks <= 0) { iTracks = iSaveTracks; break; } if (iDone == TRUE) break; } /* determine if we are to repeat the disc, iCount==0 is forever */ if (iCount > 0) { iCount --; if (iCount == 0) break; } } shuffle_unlock(iCDNum, 0); if (ioctl(cdt->fd, CDROMSTOP) == -1 ) { errormsg("%P: ioctl cdromstop: %s", strerror(errno)); } } cdtool-2.1.8/install-sh0000755000000000000000000001440610074545500013515 0ustar rootroot#!/bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 cdtool-2.1.8/hardware.c0000644000000000000000000002376710324773577013503 0ustar rootroot/* hardware.c * * Copyright 1994 thomas insel * Copyright 1995 sven oliver moll * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 dated June, 1991. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ #include #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "database.h" #include "hardware.h" #include "util.h" /* returns first track (1-based) on disk */ int first_track(const cdhw_t *hw) { return hw->tochdr.cdth_trk0; } /* returns last track (1-based) on disk */ /* note that this is the last *real* track; a LEADOUT track follows */ int last_track(const cdhw_t *hw) { return hw->tochdr.cdth_trk1; } /* track is 1-based! */ int is_audio_track(const cdhw_t *hw, int track) { return !(hw->tocentries[track - 1].cdte_ctrl & CDROM_DATA_TRACK); } /************************************************************************/ /* Procedure: read_hw * Purpose: allocate, read hardware info * * Inputs: program name, CD file descriptor * Outputs: to cdhw_t structure * Returns: pointer to cdhw_t structure * ************************************************************************/ cdhw_t *read_hw(int fd) { cdhw_t *hw; hw = malloc(sizeof(cdhw_t)); if (!hw) return hw; if (update_hw(hw, fd) < 0) { free(hw); hw = NULL; } return hw; } /************************************************************************ * Procedure: update_hw * Returns: 0 success, -1 fatal error * Purpose: read subchnl, tochdr and tocentries and write status * into hw->iStatus. ************************************************************************/ int update_hw(cdhw_t *hw, int fd) { int i; struct cdrom_tocentry *tocentry; memset(hw, 0, sizeof(cdhw_t)); /* try to get subchannel information. some reasons this can fail: * non-CDROM device (EINVAL). drive not capable of audio (ENOSYS), * tray open (EIO), no disc inserted (EIO). */ hw->subchnl.cdsc_format = CDROM_MSF; if (ioctl(fd, CDROMSUBCHNL, &hw->subchnl) < 0) { debugmsg("%P: ioctl subchnl: %s", strerror(errno)); if (errno == EINVAL || errno == ENOSYS) { errormsg("%P: drive is not audio-capable."); hw->iStatus = CD_STATUS_ERROR; hw->subchnl.cdsc_audiostatus = CDROM_AUDIO_ERROR; return(-1); } hw->iStatus = CD_STATUS_NO_CD; return(0); } /* try to read the TOC header */ if (ioctl(fd, CDROMREADTOCHDR, &hw->tochdr) < 0) { debugmsg("%P: ioctl readtochdr: %s", strerror(errno)); hw->iStatus = CD_STATUS_NO_CD; return(0); } /* check bounds of tracks */ if (hw->tochdr.cdth_trk1 > MAX_TRACKS) { errormsg("%P: unexpected end track %d in TOC", hw->tochdr.cdth_trk1); hw->tochdr.cdth_trk1 = MAX_TRACKS; } /* by now subchnl and tochdr have been read; should only get here * when there is a CD inserted */ hw->iStatus = CD_STATUS_CD_IN; hw->iData = hw->iAudio = 0; /* read individual track entries (including leadout) */ for (i = first_track(hw)-1; i <= last_track(hw); i++) { tocentry = &hw->tocentries[i]; tocentry->cdte_format = CDROM_MSF; tocentry->cdte_track = (i==last_track(hw)) ? CDROM_LEADOUT : i+1; debugmsg("%P: reading track %d tocentry", tocentry->cdte_track); if (ioctl(fd, CDROMREADTOCENTRY, tocentry) == -1) { errormsg("%P: ioctl readtocentry track %d: %s", i, strerror(errno)); hw->iStatus = CD_STATUS_ERROR; hw->subchnl.cdsc_audiostatus = CDROM_AUDIO_ERROR; return(-1); } /* determine if data or audio track, skip CDROM_LEADOUT */ if (i <= last_track(hw)) { if (is_audio_track(hw, i + 1)) hw->iAudio++; else hw->iData++; } } /* if no audio tracks, i.e., all-data disc, set status to DATA_DISC */ if (hw->iAudio == 0) { hw->iStatus = CD_STATUS_DATA_DISC; hw->subchnl.cdsc_audiostatus = CDROM_DATA_DISC; } return(0); } /************************************************************************ * Procedure: check_audio_range() * Purpose: determine last audio track in the requested range * Returns: >0 last audio track, -1 no audio tracks in range * ************************************************************************/ int check_audio_range(cdhw_t *hw, int trk0, int trk1) { int newlast, rest, warned; for (; trk0 <= trk1; trk0++) if (is_audio_track(hw, trk0)) break; if (trk0 > trk1) /* no audio tracks within requested range */ return(-1); for (newlast = trk0; newlast < trk1; newlast++) if (!is_audio_track(hw, newlast + 1)) break; for (rest=newlast+1, warned=0; rest <= trk1; rest++) if (is_audio_track(hw, rest)) { if (!warned) { errormsg("%P: warning, only playing to first " "data track in range"); fprintf(stderr, " audio tracks"); warned = 1; } fprintf(stderr, " %d", rest); } if (warned) errormsg(" will be missed"); return newlast; } /************************************************************************* * Procedure: check_disc * Purpose: determine if there may be an audio disc inserted ************************************************************************/ int check_disc(cdhw_t *hw) { int status; switch (hw->iStatus) { case CD_STATUS_CD_IN: case CD_STATUS_INSERTED: status = 1; break; case CD_STATUS_ERROR: case CD_STATUS_NO_CD: case CD_STATUS_REMOVED: case CD_STATUS_MOUNTED: case CD_STATUS_DATA_DISC: default: status = 0; } return(status); } /************************************************************************/ /* Procedure: cd_status_text * Purpose: to get status name in text * * Inputs: status code * Outputs: to buffer * Returns: pointer to status text string * Notes: * 1. Input values: * * 0 No CD in drive. * 1 CD in drive. * 2 CD has just been inserted (TOC has been read) * 3 CD has just been removed * 4 CD is mounted * */ /************************************************************************/ char *cd_status_text (int iStatus) { char *pszResult; switch (iStatus) { case CD_STATUS_ERROR: pszResult = "error"; break; case CD_STATUS_NO_CD: pszResult = "no_disc"; break; case CD_STATUS_CD_IN: pszResult = "disc_in"; break; case CD_STATUS_INSERTED: pszResult = "inserted"; break; case CD_STATUS_REMOVED: pszResult = "removed"; break; case CD_STATUS_MOUNTED: pszResult = "mounted"; break; case CD_STATUS_DATA_DISC: pszResult = "data_disc"; break; default: pszResult = "unknown"; break; } return (pszResult); } /* convert track offset to MSF format */ struct cdrom_msf * msf_from_tracks(cdhw_t *hw, int first, int last) { struct cdrom_msf *msf; if (first < 1 || first > hw->tochdr.cdth_trk1) { errormsg("%P: invalid first track %d", first); return NULL; } msf = malloc(sizeof(*msf)); if (!msf) return NULL; /* use MSF start of the first track (one-based) */ msf->cdmsf_min0 = hw->tocentries[first-1].cdte_addr.msf.minute; msf->cdmsf_sec0 = hw->tocentries[first-1].cdte_addr.msf.second; msf->cdmsf_frame0 = hw->tocentries[first-1].cdte_addr.msf.frame; if (last < 1 || last > hw->tochdr.cdth_trk1) { errormsg("%P: invalid last track %d", last); free(msf); return NULL; } /* use MSF stop from the start of the track _after_ "last" */ msf->cdmsf_min1 = hw->tocentries[last].cdte_addr.msf.minute; msf->cdmsf_sec1 = hw->tocentries[last].cdte_addr.msf.second; msf->cdmsf_frame1 = hw->tocentries[last].cdte_addr.msf.frame; return msf; } /************************************************************************/ /* Procedure: do_play_ti * Purpose: to start playing * Inputs: track index * Returns: 0< on error; 0 on success * ************************************************************************/ int do_play_ti(int fd, cdhw_t *hw, struct cdrom_ti *ti) { #ifdef NOSCSI if (ioctl(fd, CDROMPLAYTRKIND, ti) < 0) { /* patch by for Plextor */ /* PX-32TSI drive: retry with all indices set to 1 */ ti->cdti_ind1 = 1; if (ioctl(fd, CDROMPLAYTRKIND, ti) < 0) { errormsg("%P: ioctl cdromplaytrkind: %s", strerror(errno)); return(-1); } } #else struct cdrom_msf *msf; if (ioctl(fd, CDROMSTART) < 0) { errormsg("%P: ioctl cdromstart: %s", strerror(errno)); return(-1); } /* convert track index into MSF format */ msf = msf_from_tracks(hw, ti->cdti_trk0, ti->cdti_trk1); if (!msf) return(-1); if (ioctl(fd, CDROMPLAYMSF, msf) == -1) { errormsg("%P: ioctl cdromplaymsf: %s", strerror(errno)); return(-1); } free(msf); #endif return(0); }