zlibc-0.9k/0000755000076400001440000000000010210675156013254 5ustar aknaffusers00000000000000zlibc-0.9k/setxattr.c0000444000076400001440000000151207663767167015321 0ustar aknaffusers00000000000000/* * setxattr.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef HAVE_GETXATTR int setxattr(__const char *file_name, const char *name, const void *value, size_t size, int flags) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_setxattr(file_name, name, value, size, flags); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Getxattr %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_setxattr(newname, name, value, size, flags); } #endif zlibc-0.9k/contrib/0000755000076400001440000000000007663760427014732 5ustar aknaffusers00000000000000zlibc-0.9k/contrib/GZip0000555000076400001440000001032207306412072015505 0ustar aknaffusers00000000000000#!/bin/csh -fb set noglob = ( ) # This program is copyright 1993 by Bill C. Riemers, under the same terms of # gzip. If this is to restrictive, let me know and I will consider relaxing # it. (bcr@physics.purdue.edu, bcr@cernapo.cern.ch) # Put explicit paths here. I'm not sure if this will work with other programs. set gzip_data = ( gzip ) set ungzip_data = ( gunzip ) set compress_exec = ( tcx ) set uncompress_exec = ( untcx -u ) # What is the smallest size file you wish to compress in kilobytes @ minsize = 5 # Filenames to always exclude (things that you are constantly using...) # There is no need to list suid programs. Wildcards are permitted. set exclude = ( \ vmlinuz zSystem.map zImage* emacs lemacs *wm \ xinit getty selection uugetty syslogd *clock \ *sh X386 XF86_* \ *.Z *.gz *.tgz *.taz *.tpz *.gif \ ) # We can also exclude directories and paths ... set path_exclude = ( \ */tmp/* /mnt/* /sbin/* /bin/* /etc/* /usr/spool/* \ ) # Default extention set suffix = .GZ # The rest of this is the script. if ! $?ZLIB_SUFFIX setenv ZLIB_SUFFIX $suffix set goto = $0 set options = ( --suffix "$ZLIB_SUFFIX" ) set files = ( ) set maxdepth = ( -maxdepth 0 ) process_arguments: foreach option ( $argv:q ) if ! ( $?add_next_option ) then if( "X$option:q" =~ "X-"* & ! $?expression ) then if ( "X$option:q" =~ X--* ) then switch ( "X$option:q" ) case X--suffix: set add_option = ( ) set add_next_option = ( ) breaksw case X--ascii: case X--force: case X--list: case X--no-name: case X--name: case X--quiet: case X--verbose: case X--fast: case X--best: set add_option = ( ) breaksw case X--decompress: case X--uncompress: set goto = Gunzip breaksw case X--stdout: case X--to-stdout: case X--license: case X--test: if ( $goto == GZip ) exec $gzip_data --suffix "$ZLIB_SUFFIX" $argv:q exec $ungzip_data --suffix "$ZLIB_SUFFIX" $argv:q breaksw case X--recursive: set maxdepth = ( ) breaksw endsw else if ( "X$option:q" == X-*d* ) then set goto = Gunzip endif if ( "X$option:q" =~ X-S* ) then set add_option = ( ) goto break_option endif if ( "X$option:q" =~ X-*[aflnNq,0-9]* ) then set add_option = ( ) endif if ( "X$option:q" =~ X-*[cLt]* ) then if ( $goto == GZip ) exec gzip --suffix "$ZLIB_SUFFIX" $argv:q exec gunzip --suffix "$ZLIB_SUFFIX" $argv:q endif if ( "X$option:q" =~ X-*r* ) set maxdepth = ( ) endif else set files = ( $files:q $option:q ) unset expression endif else set add_option = ( ) unset add_next_option endif break_option: if $?add_option then set options == ( $options:q $option:q ) unset add_option endif end minimum_size: set sizes = ( -not -empty -not -size 1k ) while ( $minsize > 1 ) set sizes = ( $sizes -not -size "$minsize"k ) @ minsize-- end excluded_files: set exclude_files = ( ) foreach file ( g{,un}zip zcat $compress_exec[1]:q $uncompress_exec[1]:q $exclude:q ) set exclude_files = ( $exclude_files -not -name $file ) end exclude_dirs: set exclude_dirs = ( ) foreach dir ( /proc/* /tmp/* $path_exclude ) set exclude_dirs = ( $exclude_dirs -not -path $dir ) end goto $goto:t exit 1 GZip: find $files $maxdepth -type f -not -perm +7111 \ $sizes $exclude_files:q $exclude_dirs:q -links 1 -not -fstype proc \ -exec $gzip_data:q $options:q '{}' ';' if ( $?compress_exec ) then find $files $maxdepth -type f -perm +111 -not -perm +7000 \ $sizes $exclude_files:q $exclude_dirs:q -links 1 -not -fstype proc \ -not -name lib*.so -not -name lib*.so.* -not -name ld.so \ -exec $compress_exec:q '{}' ';' endif exit 0 Gunzip: find $files $maxdepth -type f -not -perm +7111 \ -not -empty $exclude_files:q $exclude_dirs:q -links 1 -not -fstype proc \ -exec $ungzip_data:q $options:q '{}' ';' if ( $?uncompress_exec ) then find $files $maxdepth -type f -perm +111 -not -perm +7000 \ -not -empty $exclude_files:q $exclude_dirs:q -links 1 -not -fstype proc \ -not -name lib*.so -not -name lib*.so.* -not -name ld.so \ -exec $uncompress_exec:q '{}' ';' endif exit 0 zlibc-0.9k/contrib/compress_news0000555000076400001440000000111107306412072017517 0ustar aknaffusers00000000000000#!/bin/sh # compress_news # compresses news articles under /var/spool/news older than 6 days USER=${USER-$LOGNAME} if test -z "$USER"; then echo No \$USER set >&2 exit 1 elif test "$USER" != news; then echo Must be news >&2 exit 1 else renice 19 $$ # very nice days=+6 # only compress older than 6 days size=+1k # pointless to compress files smaller than block size parallel=4 # run several gzips at once cd /var/spool/news date df . zfind . -type f -size $size -name '*[0-9]' -ctime $days -print | \ xargs -n 999 -P $parallel gzip -q df . date fi zlibc-0.9k/contrib/newspress0000555000076400001440000000625207306412072016674 0ustar aknaffusers00000000000000#!/bin/bash # USAGE: newspress [-l <#links>] [ ...] # # Option "-l" forces to search and compress all arcticles with a given number # of links (thread). If this option is not used, all articles # are compressed regardless of the number of links. # This is realy SLOWLY since corresponding filenames in several # newsgroups have to be searched first! # # Option "-s" gives the minimal size of a news article to be compressed. # Default is 1k # # Option "-t" test only the existance of files and do not compress # # ToDo: trap handling to avoid interupting the script, while creating # the sequence of links and the compressed file # (function compresslinks). # # Version. 0.1 (16. March 1997) # # Please send bugfixes / enhancements to the author # Author: reiner@schildi.xnc.com Germany export LD_ZLIB_DISABLE=1 NEWSSPOOL=/var/spool/news # ADJUST TO YOUR NEEDS !!! LOGDEV="/dev/null" size="-size +1k"; testonly=0; function usage() { echo "USAGE:" $0 '[-l <#links>] [-s ] [-v] [ ...]' } function findlinks () { while read fname; do # numlinks=`ls -l $fname | awk ' {print $2}'` ngroup=`dirname $fname` groups=`awk '/Newsgroups: / { print $2}' $fname | tr ',.' ' /'` ifile=`ls -i $fname | awk ' {print $1}'` echo "SEARCHFOR INODE $ifile IN $groups" > $LOGDEV; for group in $groups; do if [ -d $NEWSSPOOL/$group ]; then if [ "$NEWSSPOOL/$group" = "$ngroup" ]; then echo -n "$fname "; echo -n "$fname " > $LOGDEV; else fname="`find $NEWSSPOOL/$group -maxdepth 1 -inum $ifile`"; if [ $? = 0 ]; then echo -n "$fname "; echo -n "$fname " > $LOGDEV; else echo > $LOGDEV; echo "$ifile NOT FOUND in $group" > $LOGDEV; fi fi fi done echo ; echo > $LOGDEV; done } function compresslinks () { while read crosspost; do tocompress=`echo $crosspost | cut -d ' ' -f 1` compressed=$tocompress.gz echo "gzip -9 -c $tocompress > $compressed" > $LOGDEV; gzip -9 -c $tocompress > $compressed chmod +rw $compressed chown news.news $compressed if [ $testonly != 0 ]; then echo "TESTING $crosspost" > $LOGDEV return 0; else for tolink in $crosspost; do if [ ! -r $tolink.gz ]; then echo "ln $compressed $tolink.gz; " > $LOGDEV; ln $compressed $tolink.gz; fi if [ -r $tolink -a -r $tolink.gz ]; then echo "rm -f $tolink" > $LOGDEV; rm -f $tolink; else echo "Problem with $tolink" > $LOGDEV; fi done fi done } # ******************************* M A I N ******************************** findopt=""; links=""; while getopts "vtl:s:" opt; do case $opt in l) links="-links $OPTARG" ;; s) size="-size $OPTARG" ;; t) testonly=1; LOGDEV="`tty`" ;; v) LOGDEV="`tty`" ;; ?) usage; exit ;; esac done if [ "$OPTIND" -gt 1 ] ; then shift $[$OPTIND - 1]; fi if [ $# = 0 ]; then usage; exit; fi findopt="$links $size"; for newsdir in $*; do newsdir=`echo $newsdir | tr '.' '/'` # accept syntax newsgrp.newsgrp find $NEWSSPOOL/$newsdir -type f $findopt \! -name "*.gz" | findlinks | compresslinks done echo > $LOGDEV; zlibc-0.9k/rename.c0000444000076400001440000000223110205723316014657 0ustar aknaffusers00000000000000/* * rename.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #include "stat.h" int rename(__const char *file_name1, __const char *file_name2) { int st; char newname1[MAXPATHLEN + MAXEXTLEN + 1]; char newname2[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st = zlib_real_rename(file_name1, file_name2); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name1,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; strncpy(newname1,file_name1,1024); strcat(newname1,zlib_ext); strncpy(newname2,file_name2,1024); strcat(newname2,zlib_ext); errno = 0; st = zlib_real_rename(newname1, newname2); if ( st >= 0 || errno != EINVAL ) return st; /* we have EINVAL. Does this come from the source or the target ? */ st = ___zlibc_testexistence(newname1); if ( st >= 0 ){ /* old name exists. EINVAL is caused by target. keep it */ errno = EINVAL ; return -1; } else return -1; /* else the old name does not exist. return ENOENT (is already there) */ } zlibc-0.9k/readdir_tmpl.c0000444000076400001440000000324710206037777016100 0ustar aknaffusers00000000000000 static void ADJUST_NAME(int fd, struct DIRENT *de) { int l; char *extension; if (zlib_mode & CM_VERBOSE) fprintf(stderr,"Adjust name: %s\n", de->d_name); l = NAMLEN(de); /* substitute .z by nothing */ if (l > zlib_extlen){ /* we ask for name-length stricly bigger than extlen, in order to * avoid empty file names :-) */ extension = (de->d_name + l - zlib_extlen); if (strncmp(extension, zlib_ext, zlib_extlen) == 0 ){ *extension='\0'; if ( (zlib_getfiletype(de->d_name,fd) & PM_READ_MASK) >= PM_DIR_LEAVE_COMPR) { if(zlib_mode & CM_VERBOSE) fprintf(stderr,"Leave %s compressed\n", de->d_name); /* put back into place, if we "hide" these files */ *extension=*zlib_ext; } #ifdef HAVE_NAMLEN else de->d_namlen -= zlib_extlen; #endif } } } #ifdef SYS_readdir struct DIRENT *READDIR(DIR *dirp) { struct DIRENT *de; de = real_READDIR(dirp); if(!de) return de; zlib_initialise(); if(zlib_mode & ( CM_DISAB | CM_READDIR_COMPR)) return de; #if defined(__GLIBC__) && __GLIBC__ >= 2 ADJUST_NAME(dirfd(dirp), de); #else ADJUST_NAME(dirp->dd_fd, de); #endif return de; } #endif #ifdef real_GETDENTS int GETDENTS(int fd, struct DIRENT *dirp, unsigned int count) { int left; _zlibc_init(); count=real_GETDENTS(fd, dirp, count); if(count<=0) return count; zlib_initialise(); if(zlib_mode & ( CM_DISAB | CM_READDIR_COMPR)) return count; if (zlib_mode & CM_VERBOSE) fprintf(stderr,"getdents\n"); for(left = count; left; left -= dirp->d_reclen, dirp = (struct DIRENT *) ((char *)dirp + dirp->d_reclen)) ADJUST_NAME(fd, dirp); return count; } #endif zlibc-0.9k/unlink.c0000444000076400001440000000160510205732764014723 0ustar aknaffusers00000000000000/* * unlink.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #include "stat.h" int unlink(__const char *file_name) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st = zlib_real_unlink(file_name); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Unlinking %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); st=0; if ( zlib_mode & CM_UNLINK) st= zlib_real_unlink(newname); else st = ___zlibc_testexistence(newname); if ( st < 0 ){ errno = ENOENT; return st; } /* the file exists with z extension, ignore error */ return 0; } zlibc-0.9k/aix-syscall.c0000444000076400001440000000212107306412072015641 0ustar aknaffusers00000000000000 #include "sysincludes.h" /* commands with one filename and one "other" argument */ #define ALIAS(name, alias, type) \ int alias(char *filename, type var) \ { \ return name(filename, var); \ } ALIAS(access, zlib_real_access, int) ALIAS(chmod, zlib_real_chmod, int) ALIAS(stat, zlib_real_stat, struct stat*) ALIAS(lstat, zlib_real_lstat, struct stat*) int utimes(); ALIAS(utimes, zlib_real_utimes, struct timeval *) #undef ALIAS /* commands with two filenames */ #define ALIAS(name, alias) \ int alias(const char *filename, const char *filename2) \ { \ return name(filename, filename2); \ } ALIAS(link, zlib_real_link); ALIAS(symlink, zlib_real_symlink); ALIAS(rename, zlib_real_rename); #undef ALIAS int zlib_real_chown(const char *filename, int o, int g) { return chown(filename, o, g); } int open(); int zlib_real_open(const char *pathname, int flags, mode_t mode) { return open(pathname, flags, mode); } int zlib_real_unlink(const char *pathname) { return open(pathname); } int zlib_real_readlink(const char *path, char *buf, size_t bufsiz) { return readlink(path, buf, bufsiz); } zlibc-0.9k/aix-syscall.h0000444000076400001440000000153207306412072015653 0ustar aknaffusers00000000000000/* commands with one filename and one "other" argument */ #define ALIAS(alias, type) \ int alias(char *filename, type var); ALIAS(zlib_real_access, int) ALIAS(zlib_real_chmod, int) ALIAS(zlib_real_stat, struct stat*) ALIAS(zlib_real_lstat, struct stat*) #ifdef SYS_UTIME ALIAS(zlib_real_utime, struct utimbuf *) #endif #ifdef SYS_UTIMES int utimes(); ALIAS(zlib_real_utimes, struct timeval *) #endif #undef ALIAS /* commands with two filenames */ #define ALIAS(alias) \ int alias(const char *filename, const char *filename2); ALIAS(zlib_real_link); ALIAS(zlib_real_symlink); ALIAS(zlib_real_rename); #undef ALIAS int zlib_real_chown(const char *filename, int o, int g); int zlib_real_open(const char *pathname, int flags, mode_t mode); int zlib_real_unlink(const char *pathname); int zlib_real_readlink(const char *path, char *buf, size_t bufsiz); zlibc-0.9k/README0000444000076400001440000000621107620267751014143 0ustar aknaffusers00000000000000 ZLIBC - Uncompressing C Library (For Linux and SunOs) by Alain Knaff 1993-1999 Zlibc is a preloadable shared object that allows executables to uncompress the datafiles that they need on the fly. No kernel patch, no recompilation of these executables and no recompilation of the libraries is needed. This package overrides the "open" function (and other system call functions) in the shared library. This package uses the LD_PRELOAD/LD_LIBRARY_PATH mechanism to redirect the dynamic linker to use the relevant functions out of uncompress.o instead of the shared library. Thus, it should work with every release of the shared library. (An older, not recommended way to use zlibc is to have it patch the jumptable. This is only available for a.out on Linux.) How it works: ============= Usually, programs don't make system calls directly, but instead call a function which does them. To open a file, first the "open" function is called, and then this function makes the actual syscall. This package patches the "open" function and other related functions. With the zlibc, if the "open" system call fails because the file doesn't exist, the "open" function constructs the filename of a compressed file by appending .gz to the filename supplied by the user program. If this compressed file exists, it is opened and piped trough gunzip(1), and the descriptor of the read end of this pipe is returned to the caller. For certain extensions, the .gz file is first uncompressed into a temporary file, and a read descriptor for this file is passed to the caller. This is necessary if the caller wants to call lseek on the descriptor or mmap it. A description of data files for which this is necessary can be given in the configuration files /usr/lib/zlibrc and ~/.zlibrc. See zlibrc(5) for a detailed description of the syntax of these configuration files. Further Documentation: ====================== The most up to date documentation is the texinfo documentation. * To generate a printable copy, run the following commands: ./configure; make dvi; dvips zlibc.dvi * To generate a html copy, run: ./configure; make html A premade html copy can be found at: http://www.tux.org/pub/knaff/zlibc/zlibc_toc.html * To generate an info copy (browsable using emacs' info mode), run: ./configure; make info This doc looks most pretty when printed or as html. Indeed, in the info version certain examples are difficult to read due to the quoting conventions in info. Manpages are less up to date and probably less readable as well. There is also a sample configuration file called zlibrc.sample. The compiled-in defaults are fairly complete, so normally you don't need to use the run-time compilation. (The zlibrc.sample file reflects roughly the compiled-in defaults.) The file CAVEATS describes the limitations of this package. The file BUGS describes the bugs of this package. The file FAQ contains frequently asked questions and answers. It is regularily updated on http://zlibc.linux.lu/FAQ.html Have fun, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Alain L. Knaff alain@knaff.lu zlibc-0.9k/readconfig.h0000444000076400001440000000126707306412072015530 0ustar aknaffusers00000000000000/* * readconfig.h * * Copyright (C) 1993 Alain Knaff */ /* pipe handling */ #define USE_TEMP_FILE 1 /* use a temp file to store uncompressed file */ #define USE_PIPE 2 /* uncompress file to a pipe, but don't show it as a * pipe to stat */ #define SHOW_PIPE 3 /* uncompress file to a pipe, and show it as pipe to * stat */ #define DISABLE_ZLIB 4 /* don't use zlib at all */ /* readdir handling */ #define READDIR_COMPR 1 /* readdir shows files with their real name */ #define READDIR_UNCOMPR 2 /* readdir strips of trailing .z's */ extern int readdir_mode; /* disable package for certain commands */ #define USE_ZLIB 1 /* use package */ #define DONT_USE_ZLIB zlibc-0.9k/configure0000755000076400001440000055337010210161543015166 0ustar aknaffusers00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # 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. ## --------------------- ## ## 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= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="open.c" # 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 INSTALL_INFO XGZIP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os uncompressor compressor with_homeconf with_systemconf with_ext with_extlen with_tmpdir define_have_proc SHLIB HOST_ID 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 this package 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 System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-runtime-conf enable runtime configuration (default on) --enable-env-conf configuration with environmental variable (default on) --enable-have-proc have a proc filesystem Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-compr-ext=ext set the extension used by the compression program --with-tmpdir=dir set the directory for temporary files --with-extlen=len set the maximal acceptable length for the extension identifying compressed files --with-uncompressor=cmdline set the command line for uncompressing files --with-compressor=cmdline set the command line for compressing files (experimenatal) 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. _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 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 $as_me, 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 # Extract the first word of "install-info", so it can be a program name with args. set dummy install-info; 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_path_INSTALL_INFO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $INSTALL_INFO in [\\/]* | ?:[\\/]*) ac_cv_path_INSTALL_INFO="$INSTALL_INFO" # Let the user override the test with a path. ;; *) 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_path_INSTALL_INFO="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_INSTALL_INFO" && ac_cv_path_INSTALL_INFO="""" ;; esac fi INSTALL_INFO=$ac_cv_path_INSTALL_INFO if test -n "$INSTALL_INFO"; then echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5 echo "${ECHO_T}$INSTALL_INFO" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi for ac_prog in gzip compress compact 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_path_XGZIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $XGZIP in [\\/]* | ?:[\\/]*) ac_cv_path_XGZIP="$XGZIP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/bin:/usr/local/bin:/usr/local/gnu/bin:/usr/gnu/bin" for as_dir in $as_dummy 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_path_XGZIP="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi XGZIP=$ac_cv_path_XGZIP if test -n "$XGZIP"; then echo "$as_me:$LINENO: result: $XGZIP" >&5 echo "${ECHO_T}$XGZIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$XGZIP" && break done test -n "$XGZIP" || XGZIP="gzip" echo "$as_me:$LINENO: checking for AIX" >&5 echo $ECHO_N "checking for AIX... $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. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest* echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_strerror=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 strerror (); int main () { strerror (); ; 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_strerror="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_strerror" = no; then for ac_lib in cposix; 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 strerror (); int main () { strerror (); ; 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_strerror="-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_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6 if test "$ac_cv_search_strerror" != no; then test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $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 # 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 if test "${ac_cv_header_minix_config_h+set}" = set; then echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking minix/config.h usability" >&5 echo $ECHO_N "checking minix/config.h 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 _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 minix/config.h presence" >&5 echo $ECHO_N "checking minix/config.h 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 _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: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for minix/config.h" >&5 echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 if test "${ac_cv_header_minix_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_minix_config_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 fi if test $ac_cv_header_minix_config_h = yes; then MINIX=yes else MINIX= fi if test "$MINIX" = yes; then cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_1_SOURCE 2 _ACEOF cat >>confdefs.h <<\_ACEOF #define _MINIX 1 _ACEOF fi # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- echo "$as_me:$LINENO: checking for getpwnam in -lsun" >&5 echo $ECHO_N "checking for getpwnam in -lsun... $ECHO_C" >&6 if test "${ac_cv_lib_sun_getpwnam+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 getpwnam (); int main () { getpwnam (); ; 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_getpwnam=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sun_getpwnam=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_getpwnam" >&5 echo "${ECHO_T}$ac_cv_lib_sun_getpwnam" >&6 if test $ac_cv_lib_sun_getpwnam = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSUN 1 _ACEOF LIBS="-lsun $LIBS" fi echo "$as_me:$LINENO: checking for dlsym in -ldl" >&5 echo $ECHO_N "checking for dlsym in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlsym (); int main () { dlsym (); ; 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_dl_dlsym=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlsym=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_dl_dlsym" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlsym" >&6 if test $ac_cv_lib_dl_dlsym = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $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. */ #include #include <$ac_hdr> int main () { if ((DIR *) 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 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_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=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 opendir (); int main () { opendir (); ; 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_opendir="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_opendir" = no; then for ac_lib in dir; 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 opendir (); int main () { opendir (); ; 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_opendir="-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_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=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 opendir (); int main () { opendir (); ; 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_opendir="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_opendir" = no; then for ac_lib in x; 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 opendir (); int main () { opendir (); ; 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_opendir="-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_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi 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 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 for ac_header in sys/types.h stdio.h stdlib.h unistd.h errno.h sys/stat.h \ sys/param.h string.h strings.h syscall.h sys/syscall.h fcntl.h sys/wait.h \ time.h sys/time.h utime.h pwd.h gnu-stabs.h ansidecl.h dlfcn.h features.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 the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _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 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 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 for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_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 ((off_t *) 0) return 0; if (sizeof (off_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_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 if test "${ac_cv_struct_tm+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 int main () { struct tm *tp; tp->tm_sec; ; 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_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6 if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi 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 for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #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 ac_cv_c_inline=$ac_kw; 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 fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac for ac_func in strsep strpbrk memset 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 strchr memcpy fchdir 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 __access __chmod __chown __lstat __open __readlink \ __unlink __link __symlink __libc_open getxattr \ stat64 _xstat __xstat _xstat64 __xstat64 \ readdir64 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 utime utimes 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 # Check whether --enable-runtime-conf or --disable-runtime-conf was given. if test "${enable_runtime_conf+set}" = set; then enableval="$enable_runtime_conf" if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define RUNTIME_CONF 1 _ACEOF fi else cat >>confdefs.h <<\_ACEOF #define RUNTIME_CONF 1 _ACEOF fi; # Check whether --enable-env-conf or --disable-env-conf was given. if test "${enable_env_conf+set}" = set; then enableval="$enable_env_conf" if test x$enableval = xyes; then cat >>confdefs.h <<\_ACEOF #define ENV_CONF 1 _ACEOF fi else cat >>confdefs.h <<\_ACEOF #define ENV_CONF 1 _ACEOF fi; # Check whether --enable-have-proc or --disable-have-proc was given. if test "${enable_have_proc+set}" = set; then enableval="$enable_have_proc" if test x$enableval = xyes; then define_have_proc="#define HAVE_PROC" fi else test -d /proc/self && define_have_proc="#define HAVE_PROC" fi; # Check whether --with-compr-ext or --without-compr-ext was given. if test "${with_compr_ext+set}" = set; then withval="$with_compr_ext" else LD_ZLIB_DISABLE=1 rm -f testfile* echo zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz >testfile $XGZIP -f testfile with_ext=`LD_ZLIB_DISABLE=1 sh -c 'echo testfile.*' | sed 's/testfile//g'` LD_ZLIB_DISABLE=1 rm -f testfile.* fi; # Check whether --with-tmpdir or --without-tmpdir was given. if test "${with_tmpdir+set}" = set; then withval="$with_tmpdir" else with_tmpdir="/tmp" fi; # Check whether --with-extlen or --without-extlen was given. if test "${with_extlen+set}" = set; then withval="$with_extlen" else with_extlen=5 fi; # Check whether --with-uncompressor or --without-uncompressor was given. if test "${with_uncompressor+set}" = set; then withval="$with_uncompressor" uncompressor=`echo $with_var | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/ */","/g'` else uncompressor=$XGZIP'","-dc' fi; # Check whether --with-compressor or --without-compressor was given. if test "${with_compressor+set}" = set; then withval="$with_compressor" compressor=`echo $with_var | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/ */","/g'` else compressor=$XGZIP'","-c' fi; host_os0=`echo $host_os | sed 's/-/_/g'` host_os1=`echo $host_os0 | sed 's/\./_/g'` host_os2=`echo $host_os0 | sed 's/^\([^.]*\)\..*$/\1/g'` host_os3=`echo $host_os2 | sed 's/^\([^0-9]*\)[0-9]*$/\1/g'` host_cpu1=`echo $host_cpu | sed 's/\./_/g'` host_vendor1=`echo $host_vendor | sed 's/\./_/g'` HOST_ID="-D$host_cpu1 -D$host_vendor1 -D$host_os1" if [ $host_os1 != $host_os2 ] ; then HOST_ID="$HOST_ID -D$host_os2" fi if [ $host_os1 != $host_os3 ] && [ $host_os2 != $host_os3 ] ; then HOST_ID="$HOST_ID -D$host_os3" fi my_host_os=`echo $host_os1 $host_os2 $host_os3 | sort -u` objs=`echo $srcdir/*.c | sed 's/\.c$/.o/' ` if [ "X$GCC" = "Xyes" ] ; then CFLAGS="$CFLAGS -O4" if [ "$host_cpu" = i486 ] ; then CFLAGS="$CFLAGS -m486" fi Wall=-Wall if [ "$host_os3" = sunos ] ; then Wall="" fi if [ "$host_os3" = ultrix ] ; then Wall="" fi if [ "$host_os3" = linux ] ; then CFLAGS="$CFLAGS -fno-strength-reduce" fi CFLAGS="$CFLAGS $Wall" fi if [ $host_vendor = linux ] ; then CFLAGS="$CFLAGS -DUSE_XDF" fi if [ $host_vendor = att ] ; then CFLAGS="$CFLAGS -Datt" fi if [ $host_os3 = xenix ] ; then CFLAGS="$CFLAGS -M2e" LDFLAGS="$LDFLAGS -M2e -i -f 5000" fi if [ $host_os3 = hpux ] ; then LDFLAGS="$LDFLAGS -z" fi if [ $host_os2 = sysv4 ] ; then SHLIB="-lc -L/usr/ucblib -lucb" else SHLIB="" fi if [ $host_os3 = isc ] ; then CFLAGS="$CFLAGS -D_SYSV3" SHLIB="-lc_s" fi ac_config_files="$ac_config_files Makefile params.h" 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 $as_me, 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="\\ config.status 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" ;; "params.h" ) CONFIG_FILES="$CONFIG_FILES params.h" ;; "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,@INSTALL_INFO@,$INSTALL_INFO,;t t s,@XGZIP@,$XGZIP,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t s,@uncompressor@,$uncompressor,;t t s,@compressor@,$compressor,;t t s,@with_homeconf@,$with_homeconf,;t t s,@with_systemconf@,$with_systemconf,;t t s,@with_ext@,$with_ext,;t t s,@with_extlen@,$with_extlen,;t t s,@with_tmpdir@,$with_tmpdir,;t t s,@define_have_proc@,$define_have_proc,;t t s,@SHLIB@,$SHLIB,;t t s,@HOST_ID@,$HOST_ID,;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 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 # 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; } _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 zlibc-0.9k/oldconfig.h0000444000076400001440000000103207306412072015361 0ustar aknaffusers00000000000000/* this file is generated automatically, do not edit */ /* directory for temporary uncompressed files */ #define TMP "/tmp" /* extension for compressed files */ #define EXT ".gz" /* maximal length of user-supplied extension */ #define MAXEXTLEN 5 /* program used to uncompress files */ #define UNCOMPR "/usr/bin/gzip", "-dc" /* use /proc filesystem to find out command name */ #define HAVE_PROC /* per user configuration file */ #define HOMECONF ".zlibrc" /* system wide configuration file */ #define SYSTEMCONF "/usr/lib/zlibrc" zlibc-0.9k/llistxattr.c0000444000076400001440000000141307620302027015622 0ustar aknaffusers00000000000000/* * llistxattr.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef HAVE_GETXATTR int llistxattr(__const char *file_name, char *list, size_t size) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_llistxattr(file_name, list, size); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Getxattr %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_llistxattr(newname, list, size); } #endif zlibc-0.9k/configure.in0000444000076400001440000001361610206037210015556 0ustar aknaffusers00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(open.c) AC_CONFIG_HEADER(config.h) dnl checks for programs dnl =================== AC_PROG_CC AC_PROG_GCC_TRADITIONAL AC_PROG_INSTALL AC_PROG_LN_S AC_PATH_PROG(INSTALL_INFO, install-info, "") AC_PATH_PROGS(XGZIP, gzip compress compact, gzip, $PATH:/usr/bin:/usr/local/bin:/usr/local/gnu/bin:/usr/gnu/bin) dnl check for gzip extension dnl ======================== dnl check for systems dnl ================= AC_AIX AC_ISC_POSIX AC_MINIX AC_CANONICAL_SYSTEM dnl checks for libraries dnl ==================== dnl AC_IRIX_SUN AC_CHECK_LIB(sun, getpwnam) AC_CHECK_LIB(dl, dlsym) dnl checks for header files dnl ======================= AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(sys/types.h stdio.h stdlib.h unistd.h errno.h sys/stat.h \ sys/param.h string.h strings.h syscall.h sys/syscall.h fcntl.h sys/wait.h \ time.h sys/time.h utime.h pwd.h gnu-stabs.h ansidecl.h dlfcn.h features.h) AC_HEADER_TIME dnl checks for typedefs dnl =================== AC_TYPE_SIZE_T AC_TYPE_OFF_T dnl checks for structures dnl ===================== AC_STRUCT_TM dnl checks for compiler characteristics dnl =================================== AC_C_CONST AC_C_INLINE dnl checks for library functions dnl ============================ AC_CHECK_FUNCS(strsep strpbrk memset) dnl recommended by the autoconf doc, for HEADER_STDC AC_CHECK_FUNCS(strchr memcpy fchdir) dnl We first check for "weak" symbols. dnl AC_CHECK_FUNCS(__open _open, [break]) dnl We check for double underbar symbols. Apparently, it's these that dnl are called from other library routines, so we better override these AC_CHECK_FUNCS(__access __chmod __chown __lstat __open __readlink \ __unlink __link __symlink __libc_open getxattr \ stat64 _xstat __xstat _xstat64 __xstat64 \ readdir64 ) dnl system call, which may not be available everywhere dnl if they are absent, no need to provide them either... AC_CHECK_FUNCS(utime utimes) dnl checks for system services dnl ========================== dnl Check for configuration options dnl Enable OS/2 extended density format disks AC_ARG_ENABLE(runtime-conf, [ --enable-runtime-conf enable runtime configuration (default on)], [if test x$enableval = xyes; then AC_DEFINE(RUNTIME_CONF,1, [Define this if you want runtime configuration using .zlibrc]) fi],AC_DEFINE(RUNTIME_CONF)) dnl Enable configuration with environmental variables AC_ARG_ENABLE(env-conf, [ --enable-env-conf configuration with environmental variable (default on)], [if test x$enableval = xyes; then AC_DEFINE(ENV_CONF,1, [Define this if you want configuration using environmental variables]) fi],AC_DEFINE(ENV_CONF)) dnl Do we have a proc filesystem? AC_ARG_ENABLE(have-proc, [ --enable-have-proc have a proc filesystem], [if test x$enableval = xyes; then define_have_proc="#define HAVE_PROC" fi],[test -d /proc/self && define_have_proc="#define HAVE_PROC"]) dnl compressor extension AC_ARG_WITH(compr-ext, [ --with-compr-ext=ext set the extension used by the compression program], ,[ LD_ZLIB_DISABLE=1 rm -f testfile* echo zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz >testfile $XGZIP -f testfile with_ext=`LD_ZLIB_DISABLE=1 sh -c 'echo testfile.*' | sed 's/testfile//g'` LD_ZLIB_DISABLE=1 rm -f testfile.* ]) dnl temporary directory AC_ARG_WITH(tmpdir, [ --with-tmpdir=dir set the directory for temporary files], ,[with_tmpdir="/tmp"]) dnl maximal length of extension AC_ARG_WITH(extlen, [ --with-extlen=len set the maximal acceptable length for the extension identifying compressed files], ,[with_extlen=5]) dnl uncompressor command line AC_ARG_WITH(uncompressor, [ --with-uncompressor=cmdline set the command line for uncompressing files], [uncompressor=`echo $with_var | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/ */","/g'`], [uncompressor=$XGZIP'","-dc']) dnl compressor command line AC_ARG_WITH(compressor, [ --with-compressor=cmdline set the command line for compressing files (experimenatal)], [compressor=`echo $with_var | sed -e 's/^ *//g' -e 's/ *$//g' -e 's/ */","/g'`], [compressor=$XGZIP'","-c']) [ host_os0=`echo $host_os | sed 's/-/_/g'` host_os1=`echo $host_os0 | sed 's/\./_/g'` host_os2=`echo $host_os0 | sed 's/^\([^.]*\)\..*$/\1/g'` host_os3=`echo $host_os2 | sed 's/^\([^0-9]*\)[0-9]*$/\1/g'` host_cpu1=`echo $host_cpu | sed 's/\./_/g'` host_vendor1=`echo $host_vendor | sed 's/\./_/g'` HOST_ID="-D$host_cpu1 -D$host_vendor1 -D$host_os1" if [ $host_os1 != $host_os2 ] ; then HOST_ID="$HOST_ID -D$host_os2" fi if [ $host_os1 != $host_os3 ] && [ $host_os2 != $host_os3 ] ; then HOST_ID="$HOST_ID -D$host_os3" fi my_host_os=`echo $host_os1 $host_os2 $host_os3 | sort -u` objs=`echo $srcdir/*.c | sed 's/\.c$/.o/' ` if [ "X$GCC" = "Xyes" ] ; then CFLAGS="$CFLAGS -O4" if [ "$host_cpu" = i486 ] ; then CFLAGS="$CFLAGS -m486" fi Wall=-Wall if [ "$host_os3" = sunos ] ; then Wall="" fi if [ "$host_os3" = ultrix ] ; then Wall="" fi if [ "$host_os3" = linux ] ; then CFLAGS="$CFLAGS -fno-strength-reduce" fi CFLAGS="$CFLAGS $Wall" fi if [ $host_vendor = linux ] ; then CFLAGS="$CFLAGS -DUSE_XDF" fi if [ $host_vendor = att ] ; then CFLAGS="$CFLAGS -Datt" fi if [ $host_os3 = xenix ] ; then CFLAGS="$CFLAGS -M2e" LDFLAGS="$LDFLAGS -M2e -i -f 5000" fi if [ $host_os3 = hpux ] ; then LDFLAGS="$LDFLAGS -z" fi if [ $host_os2 = sysv4 ] ; then SHLIB="-lc -L/usr/ucblib -lucb" else SHLIB="" fi if [ $host_os3 = isc ] ; then CFLAGS="$CFLAGS -D_SYSV3" SHLIB="-lc_s" fi ] AC_SUBST(uncompressor) AC_SUBST(compressor) AC_SUBST(with_homeconf) AC_SUBST(with_systemconf) AC_SUBST(with_ext) AC_SUBST(with_extlen) AC_SUBST(with_tmpdir) AC_SUBST(define_have_proc) AC_SUBST(XGZIP) AC_SUBST(SHLIB) AC_SUBST(host_cpu) AC_SUBST(HOST_ID) AC_OUTPUT(Makefile params.h) zlibc-0.9k/listxattr.c0000444000076400001440000000140707620302027015451 0ustar aknaffusers00000000000000/* * listxattr.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef HAVE_GETXATTR int listxattr(__const char *file_name, char *list, size_t size) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_listxattr(file_name, list, size); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Getxattr %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_listxattr(newname, list, size); } #endif zlibc-0.9k/zlibc.conf.sample0000444000076400001440000001151607306730177016517 0ustar aknaffusers00000000000000# sample zlibrc file # by default, commands may also unlink compressed files commands default use unlink commands "xman" use disable # Eamcs has its own way of handling compressed files commands "xemacs" use disable disable_child # disable zlib for compressors. Add any other compressors you use to this # list commands "gzip" "gunzip" "compress" "uncompress" use disable # keep rm -r working commands "rm" use readdir_compr unlink # avoid accidentally expanding files while burning a CD commands "mkisofs" use disable # ls, shows all uncompressed files as pipes, to allow the user to spot # the compressed files easily. Don't use this on a Sun, else you lose # the size information. commands "ls" "patch" use "showpipe" # find doesn't show pipes. This is useful for constructions like # find . -type f -grep pattern {} \; # where you don't want to grep through REAL fifos, but where you want to # grep through compressed files. # # less can scroll backwards. Allow it to seek. # # file makes several passes (magic and language) Between each pass, it seeks # back to the beginning commands "less" "file" "xdvi" "xman" "smalltalk" use "nopipe" # find does't show pipes and shows the compressed size. Showing the # uncompressed size would force find to open every file searched, # which would harm performance commands "find" use "find" #zzsh, zls and zfind are links to sh, ls and find. They allow scripts #to avoid running gzip on non-existant files. If we used find it would #print the name of a compressed article as (say) 1234 instead of 1234.gz #and gzip would complain no such file which would be harmless but #inefficient. zzsh has to z to avoid confusion with the zsh shell commands "zzsh" "zfind" "zls" use disable # newsreaders and daemons do seeks commands "nn" "tin" "rn" "trn" "xrn" "in.nnrpd" use "nopipe" # lisp loads all its files much faster when using the tmp file method # don't know why. commands "clisp" "smalltalk" "lisp.run" "lisp" use "nopipe" # special actions for emacs. commands "emacs" use "emacs" disable_child # special actions for X. Add all your X servers to this line commands "XF86_SVGA" "XF86_Mono" "XF86_S3" "XF86_VGA16" "XF86_Accel" use "X" # backups, archive and copy programs don't use pipe decompression. # This is because if these programs see fifos, they don't archive/copy # their data but rather recreate a REAL fifo, thus losing the contents # of the pipe. # mv should not see pipes, else it refuses to move files accross filesystems. # anyways, files get uncompressed when they are moved accross filesystems. # cp -rf on a directory will work as expected, as it will see the compressed # file names as it browses through the directories commands "tar" "cpio" "pax" "cp" "mv" use readdir_compr "generic_safe" # Unlike emacs, the following editors are too primitive to have their # own compressed file mode. Fortunately, zlibc has now limited compressed # write support :-) # This is commented out by default, as some people might dislike it because # new files will always be created compressed. #commands "elvis" "vi" use "vi" # the default class generic_safe now. This is to stay safe if somebody uses # a backup or copy program other than those listed above. If you use only # the backup programs listed above, you may safely change "generic_safe" into # "generic". If you use different backup programs, you may add them to the # list above and still change "generic_safe" into "generic". This default is # there to prevent nasty surprises to people who use different backup progs, and # don't read the doc. commands default use "generic_safe" class "vi" subdir "/tmp" no-create-compressed all create-compressed all uncompress-before-write usetmpfile # X uses tmp files in its own directories. class "X" subdir "/usr/X11R6" usetmpfile subdir "/usr/X386" usetmpfile subdir "/usr/lib/X11" usetmpfile showpipe # generic class which uses temp files for all files. class "nopipe" usetmpfile # generic class which hides all pipes class "hidepipe" hidepipe # generic class which shows all pipes class "showpipe" showpipe # class for find class "find" all show-compressed-size usetmpfile # emacs doesn't see virtual uncompressed files except in its own directories. # this forces emacs to use its own compression support (crypt.el) whenever # possible. class "emacs" subdir "/usr/lib/emacs" showpipe subdir "/usr/info" hidepipe leavecompressed # default class (not used any more) class "generic" suffix ".tar" dirleavecompressed # compressed tar file. Better use tar's z option suffix ".a" usetmpfile # static library suffix ".sa" usetmpfile # stub library suffix ".o" usetmpfile # object file suffix ".pcf" usetmpfile # X fonts suffix ".pag" usetmpfile # generic mmap'ed file suffix ".mem" usetmpfile # idem suffix "CompKeyDB" usetmpfile # xfig showpipe class "generic_safe" suffix ".tar" dirleavecompressed # compressed tar file. Better use tar's z option usetmpfile zlibc-0.9k/zlibc.h0000444000076400001440000001336110206046407014526 0ustar aknaffusers00000000000000/* * zlibc.h * * Copyright (C) 1993 Alain Knaff */ #ifndef ZLIBC_H #define ZLIBC_H #define FA_ALL 0 #define FA_DIR 1 #define FA_SUBDIR 2 /* FA_DIR and FA_SUBDIR should be specified with their trailing slash */ #define FA_BASENAME 3 #define FA_SUFFIX 4 #define FA_FILENAME 5 #define FA_ALL2 6 #define FA_FS 7 #define PM_NONE 0 #define PM_USE_TMP_FILE 1 #define PM_HIDE_PIPE 2 #define PM_SHOW_PIPE 3 #define PM_DIR_LEAVE_COMPR 4 #define PM_LEAVE_COMPR 5 #define PM_READ_MASK 7 #define PM_CREATE_COMPR 0x8 #define PM_NOCREATE_COMPR 0x10 #define PM_CREATE_MASK 0x18 #define PM_APPEND_COMPR 0x20 #define PM_NOAPPEND_COMPR 0x40 #define PM_APPEND_MASK 0x60 #define PM_UNCOMPR_BEFORE_WRITE 0x80 #define PM_NO_UNCOMPR_BEFORE_WRITE 0x100 #define PM_UNCOMPR_MASK 0x180 #define PM_SIZE_COMPR 0x200 #define PM_SIZE_UNCOMPR 0x400 #define PM_SIZE_COMPR_MASK 0x600 typedef struct FilenameActions { /* initialized elements. MUST be in this order in order to support compiled-in defaults */ int fa_type; char *name; int namelength; int pipe_mode; /* elements that are computed at runtime */ dev_t dev; ino_t ino; int is_initialized; } FilenameActions; int _zlibc_init(void); /* the file actions have been read */ #define CM_HAVE_FA 0x1 /* disable package altogether */ #define CM_DISAB 0x2 /* readdir lists compressed files */ #define CM_READDIR_COMPR 0x4 /* print comments for each intercepted syscall */ #define CM_VERBOSE 0x8 /* unlinks compressed files when user programs asks to unlink * uncompressed file */ #define CM_UNLINK 0x10 /* doesn't read run time configuration file */ #define CM_NORTCONF 0x20 /* doesn't read run time configuration file */ #define CM_DISAB_CHILD 0x40 /* all available file-settable modes or'ed together, except NORTCONF */ #define CM_ALL_MODES 0x5f /* none of these flags */ #define CM_NONE 0 typedef struct CommandActions { char *name; int cm_type; FilenameActions *actions; } CommandActions; extern CommandActions zlib_commandActions[]; #define FREC(a,b,c) { a, b, sizeof(b) - 1, c } #if 0 #ifdef HAVE___ACCESS #define access __access #endif #ifdef HAVE___CHMOD #define chmod __chmod #endif #ifdef HAVE___CHOWN #define chown __chown #endif #ifdef HAVE___LSTAT #define lstat __lstat #endif #ifdef HAVE___STAT #define lstat __stat #endif #if 0 #ifdef HAVE___OPEN #define open __open #endif #ifdef HAVE___READLINK #define readlink __readlink #endif #ifdef HAVE___UNLINK #define unlink __unlink #endif #ifdef HAVE___LINK #define link __link #endif #ifdef HAVE___SYMLINK #define symlink __symlink #endif #endif #endif #ifndef __STDC__ #define signed /**/ int fprintf(); int printf(); int _flsbuf(); int syscall(); int wait4(); int fclose(); int perror(); int getdents(); #endif void zlib_initialise(void); int zlib_getfiletype(__const char *name, int fd); void zlib_getuserconf(char *progname, FilenameActions **filenameActions, int *mode, int *modemask); extern char *zlib_ext; extern int zlib_extlen; extern int zlib_mode; extern char *zlib_tmp; extern char **zlib_uncompressor; #ifdef CONFIG_COMPILER extern char *err_strings[]; extern int generation; /* configuration file compiler */ typedef struct commands_line { char *name; int mode, modemask; struct commands_line *globalnext, *localnext; int generation; char class[16]; int defined; } commands_line; int add_prog(commands_line **cmd, char *name); int add_default(commands_line **cmd); void print_class(FilenameActions *fa, char *name, int line); int parse_file(char *progname, FILE *f, int *line, int *mode, int *modemask, char *classname); #endif /** * Stat calling stubs. These stubs are used to allow zlibc to call the * libc's original stat functions */ #ifdef HAVE___XSTAT # include # include "direct_sys.h" /* 32 bit versions */ # define STAT(x) x ## stat # define STATTYPE struct stat # define USE_XSTAT 1 # include "stat_tmpl.h" # undef USE_XSTAT # undef STATTYPE # undef STAT #else # include "direct_sys.h" # define ___zlibc_stat(ver,name,buf) (zlib_real_stat((name), (buf))) # define ___zlibc_lstat(ver,name,buf) (zlib_real_lstat((name), (buf))) #endif /* 64 bit versions */ #ifdef HAVE_STAT64 # define STATTYPE struct stat64 # define STAT(x) x ## stat64 # ifdef HAVE___XSTAT64 # define USE_XSTAT 1 # endif # include "stat_tmpl.h" # undef USE_XSTAT # undef STAT # undef STATTYPE #endif #ifndef DEFUN #define AND , #define DEFUN(name, arglist, args) name(args) #endif #ifndef function_alias #ifdef linux #define function_alias(alias, name, type, args, defun) \ __asm__(".globl " #alias "; " #alias " = " #name); #else #define function_alias(alias, name, type, args, defun) \ type defun { return name args; } #endif #endif #if (defined __ELF__ && defined elf_alias) #undef function_alias #define function_alias(alias, name, type, vars, defun) elf_alias(name, alias) #endif #define ALIAS1(name, alias, rtype, type1) \ function_alias(name, alias, rtype, \ (var1), \ DEFUN(alias, (var1), \ type1 var1)) #define ALIAS2(name, alias, rtype, type1, type2) \ function_alias(alias, name, rtype, \ (var1, var2), \ DEFUN(alias, (var1, var2), \ type1 var1 AND type2 var2)) #define ALIAS3(name, alias, rtype, type1, type2, type3) \ function_alias(alias, name, rtype, \ (var1, var2, var3), \ DEFUN(alias, (var1, var2, var3), \ type1 var1 AND type2 var2 AND type3 var3)) #define ALIASF0(name, alias) ALIAS1(name, alias, int, CONST char *) #define ALIASF1(name, alias, type2) \ ALIAS2(name, alias, int, CONST char *, type2) #define ALIASF2(name, alias, type2, type3) \ ALIAS3(name, alias, int, CONST char *, type2, type3) #define ALIAS2F(name, alias) \ ALIAS2(name, alias, int, CONST char *, CONST char *) #endif zlibc-0.9k/params.h0000444000076400001440000000031607306412072014704 0ustar aknaffusers00000000000000#define PREFIX "/usr/local" #define EXT ".gz" #define TMP "/tmp" #define MAXEXTLEN 5 #define UNCOMPR "/usr/bin/gzip","-dc" #define COMPR "/usr/bin/gzip","-c" #define HAVE_PROC #define HOMECONF ".zlibrc" zlibc-0.9k/config.guess0000644000076400001440000012513310065531173015574 0ustar aknaffusers00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2004-06-11' # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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 ;' # 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 0 ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit 0 ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit 0 ;; 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 0 ;; Alpha*:OpenVMS:*:*) echo alpha-hp-vms exit 0 ;; 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 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; *:OS400:*:*) echo powerpc-ibm-os400 exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; 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 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit 0 ;; DRS?6000:UNIX_SV:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7 && exit 0 ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; 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 0 ;; 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 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; 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 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # 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 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; 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 \ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; 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 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????: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 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; 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 0 ;; *: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 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 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 0 ;; *: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 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 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 # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 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 && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; *:UNICOS/mp:*:*) echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; 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 0 ;; 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 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) # Determine whether the default compiler uses glibc. eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #if __GLIBC__ >= 2 LIBC=gnu #else LIBC= #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` # GNU/KFreeBSD systems have a "k" prefix to indicate we are using # FreeBSD's kernel, but not the complete OS. case ${LIBC} in gnu) kernel_only='k' ;; esac echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit 0 ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit 0 ;; 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 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; *: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 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; 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 0 ;; 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 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; 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 0 ;; 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 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; 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 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # 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 0 ;; 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 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; 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 0 ;; 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 0 ;; 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 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; 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 0 ;; i*86:*:5:[78]*) 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 0 ;; 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 0 ;; 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 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; 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 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit 0 ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit 0 ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 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) 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 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *: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 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; 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 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) case `uname -p` in *86) UNAME_PROCESSOR=i686 ;; powerpc) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *: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 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *: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 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; 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"); 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 && $dummy && exit 0 # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # 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 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; 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: zlibc-0.9k/install-sh0000555000076400001440000001124407306412072015256 0ustar aknaffusers00000000000000#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # 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. # # 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}" tranformbasename="" 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=: 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 zlibc-0.9k/mkmanpages0000555000076400001440000000147310210162472015320 0ustar aknaffusers00000000000000#!/bin/sh src=`dirname $0` # zlibc.3 ( cd $src echo \'\\\" t echo .TH uncompress.so 3 "27mar1999" "ZLIBC" "ZLIBC" egrep -v '^\\input ' < $src/zlibc.texi | sed \ -e '/\\input texinfo/d' \ -e '/^@c zlibc\.3skip/,/^@c zlibc\.3end-skip/d' \ -e '/^@c MANskip/,/^@c MANend-skip/d' \ -e 's/^@c MAN/@MAN/' | texi2roff -ma | sed -f strip-pp.sed ) > zlibc.3 # zlibc.5 ( cd $src echo \'\\\" t echo .TH zlibc.conf 5 "27jun99" ZLIBC sed \ -e '/\\input texinfo/d' \ -e '/^@c zlibc-conf\.5skip/,/^@c zlibc-conf\.5end-skip/d' \ -e '/^@c MANskip/,/^@c MANend-skip/d' \ -e 's/^@c MAN/@MAN/' \ -e '/@chapter/d' \ -e '/@section/d' \ -e 's/^@subsection/@chapter/' \ -e 's/^@subs/@s/' \ -e 's/^@subs/@s/' \ -e 's/^@unnumberedsubsubsec/@subsection/' < $src/zlibc.texi | texi2roff -ma | sed -f strip-pp.sed ) > zlibc.conf.5 zlibc-0.9k/sysincludes.h0000444000076400001440000000557610205745025016002 0ustar aknaffusers00000000000000/* System includes for zlibc */ #ifndef SYSINCLUDES_H #define SYSINCLUDES_H #include "config.h" #ifdef HAVE__XSTAT # ifndef HAVE___XSTAT # define __xstat _xstat # define __lxstat _lxstat # define HAVE___XSTAT # endif #endif #ifdef HAVE__XSTAT64 # ifndef HAVE___XSTAT64 # define __xstat64 _xstat64 # define __lxstat64 _lxstat64 # define HAVE___XSTAT64 # endif #endif #ifdef linux_gnu /* RMS strikes again */ # ifndef linux # define linux # endif #endif #ifdef HAVE_ANSIDECL_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_STDIO_H # include #endif # ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_SYS_STAT_H # if defined (STAT_C) && defined(__GLIBC__) && __GLIBC__ >= 2 /* GLIBC redefines its own struct stat. Use the original one here */ # include # define stat glibc_stat # endif # include # if defined(STAT_C) && defined(__GLIBC__) && __GLIBC__ >= 2 # undef stat # endif #endif #ifdef HAVE_SYS_PARAM_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYSCALL_H # include #endif #ifdef HAVE_SYS_SYSCALL_H # include #endif #ifdef HAVE_DLFCN_H # include #endif #ifdef HAVE_FCNTL_H #define __open oldopen #define open oldopen1 #include #undef __open #undef open #endif #ifdef HAVE_TIME_H # include #endif #ifdef HAVE_SYS_TIME_H # include #endif #ifdef HAVE_UTIME_H # include #endif #ifdef HAVE_PWD_H # include #endif #if HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) #else # define dirent direct # define HAVE_NAMLEN # define NAMLEN(dirent) (dirent)->d_namlen # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif #endif #if STDC_HEADERS # include #else # ifndef HAVE_STRCHR # define strchr index # define strrchr rindex # endif char *strchr (), *strrchr (); # ifndef HAVE_MEMCPY # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if HAVE_SYS_WAIT_H # include #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif #ifndef HAVE_STRSEP extern char *strsep(); #endif #ifdef HAVE_GNU_STABS_H # include #endif #include "params.h" #include "zlibc.h" #if defined solaris /* prototype on Solaris */ int syscall(int, ...); int open(__const char *, int, mode_t); #endif #ifdef aix # undef SYS_UTIME # define SYS_UTIMES #endif #ifndef MAXPATHLEN # define MAXPATHLEN 256 #endif #endif zlibc-0.9k/access.c0000444000076400001440000000167407620267751014700 0ustar aknaffusers00000000000000/* * access.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" int access(__const char *file_name,int mode) { int ret,ft; _zlibc_init(); ret= zlib_real_access(file_name, mode); if ( ret >= 0 || errno != ENOENT ) return ret; { char newname[MAXPATHLEN + MAXEXTLEN + 1]; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return ret; ft = zlib_getfiletype(file_name,-1); if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"accessing %s %x\n", file_name,mode); if ((ft & PM_READ_MASK) == PM_LEAVE_COMPR) return ret; if (!(ft & (PM_CREATE_COMPR | PM_APPEND_COMPR | PM_UNCOMPR_BEFORE_WRITE)) && (mode & W_OK)) return ret; strncpy(newname,file_name,1024); strcat(newname,zlib_ext); ret= zlib_real_access(newname, mode); if ( ret < 0 && errno == EINVAL ) errno = ENOENT; return ret; } } zlibc-0.9k/symlink.c0000444000076400001440000000202610205723452015101 0ustar aknaffusers00000000000000/* * symlink.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #include "stat.h" int symlink(__const char *file_name1, __const char *file_name2) { int st; struct stat buf; _zlibc_init(); /* file without z exists */ st = ___zlibc_nativestat(file_name1, &buf ); if ( st < 0 && errno == ENOENT ){ char newname1[MAXPATHLEN + MAXEXTLEN + 1]; char newname2[MAXPATHLEN + MAXEXTLEN + 1]; zlib_initialise(); if ( ! ( zlib_mode & CM_DISAB ) && (zlib_getfiletype(file_name1,-1) & PM_READ_MASK) != PM_LEAVE_COMPR){ strncpy(newname1,file_name1,1024); strcat(newname1,zlib_ext); st = ___zlibc_nativestat(newname1, &buf ); /* file with z exists */ if ( st >= 0 || errno != ENOENT ){ errno = 0; strncpy(newname2,file_name2,1024); strcat(newname2,zlib_ext); return zlib_real_symlink(newname1, newname2); } } } /* neither file exists */ errno = 0; return zlib_real_symlink(file_name1, file_name2); } zlibc-0.9k/config.sub0000644000076400001440000007467010065531177015254 0ustar aknaffusers00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003 Free Software Foundation, Inc. timestamp='2004-03-12' # 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., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, 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 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 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # 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 0;; * ) 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) 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 \ | 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 | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) 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-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | 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-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | msp430-* \ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | 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-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # 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 ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; 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 ;; 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 ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; 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 ;; nv1) basic_machine=nv1-cray os=-unicosmp ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; 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 ;; 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 ;; 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 ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-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*) # 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* \ | -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 ;; -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 ;; *-ibm) os=-aix ;; *-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 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: zlibc-0.9k/stat_tmpl.c0000444000076400001440000000654310206047275015435 0ustar aknaffusers00000000000000#ifndef _STAT_VER #define _STAT_VER 0 #endif static int STAT(z)(int ver, __const char *name, char *newname, STATTYPE *buf) { int fd,st,ft; unsigned char size_buffer[4]; ft = zlib_getfiletype(name,-1); if( (ft & PM_READ_MASK) == PM_LEAVE_COMPR ){ errno = ENOENT ; return -1; } if ((ft & PM_SIZE_COMPR_MASK) == PM_SIZE_COMPR) { STAT(___zlibc_x)(ver,newname,buf); } else { fd=zlib_real_open(newname, O_RDONLY | O_NDELAY, 0); if ( fd < 0 ){ if ( errno == ENOENT ) return -1; return 2; } else { st = fSTAT; if(ver == _STAT_VER) { /* If we do know the layout of stuct stat, do some smart things * here, else don't bother */ if ( st < 0 ){ close(fd); return st; } if ( ! S_ISREG ( buf->st_mode )) { /* not a regular file. Don't waste time determining its size */ return st; } lseek(fd, -4 , SEEK_END); read(fd, size_buffer, 4 ); buf->st_size = size_buffer[0] + ( size_buffer[1] << 8 ) + (size_buffer[2] << 16 ) + (size_buffer[3] << 24 ); } close(fd); } } if(ver == _STAT_VER) { /* If we happen to know the layout of stuct stat, do some smart * things here, else don't bother */ if ((ft & PM_READ_MASK) == PM_SHOW_PIPE) { buf->st_mode ^= S_IFIFO | S_IFREG; } if (!(ft & (PM_CREATE_COMPR | PM_APPEND_COMPR | PM_UNCOMPR_BEFORE_WRITE))) buf->st_mode &= ~0222; #ifdef NEGATE_INODES buf->st_ino= -buf->st_ino; #endif } return 0; } static int STAT(zlibc_x)(int ver, __const char *file_name, STATTYPE *buf) { int st, olderrno; olderrno = errno; errno = 0; st = STAT(___zlibc_x)(ver, file_name, buf ); if ( st >= 0 || errno != ENOENT ) return st; { char newname[MAXPATHLEN + MAXEXTLEN + 1]; zlib_initialise(); if ( zlib_mode & CM_DISAB ) { errno = ENOENT; return st; } if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"stating %s\n", file_name); strncpy(newname,file_name,MAXPATHLEN); strcat(newname,zlib_ext); st = STAT(z)(ver, file_name,newname, buf); if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"stated %s, rv=%d\n", file_name, st); if ( st == 2 ){ st = STAT(___zlibc_x)(ver, newname, buf); if(ver == _STAT_VER) buf->st_size = 0; } if ( st < 0 ){ errno = ENOENT; return st; } } errno = olderrno; return st; } static int STAT(zlibc_lx)(int ver, __const char *file_name, STATTYPE *buf) { int st, olderrno; olderrno = errno; st = STAT(___zlibc_lx)(ver,file_name, buf); if ( st >= 0 || errno != ENOENT ) return st; { char newname[MAXPATHLEN + MAXEXTLEN + 1]; zlib_initialise(); if ( zlib_mode & CM_DISAB ) { errno = ENOENT; return st; } if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"lstating %s\n", file_name); strncpy(newname,file_name,MAXPATHLEN); strcat(newname,zlib_ext); st = STAT(___zlibc_lx)(ver,newname, buf); if ( st < 0 ){ errno = ENOENT; return st; } if (ver == _STAT_VER && S_ISLNK(buf->st_mode) ){ if ( (signed int) buf->st_size > zlib_extlen ) buf->st_size -= zlib_extlen; errno = olderrno; return st; } st = STAT(z)(ver,file_name,newname,buf); if ( st == 2 ) /* could not zstat it, keep first info */ st=0; } errno = olderrno; return st; } zlibc-0.9k/stat_tmpl.h0000444000076400001440000000067010205746077015442 0ustar aknaffusers00000000000000static inline int STAT(___zlibc_lx)(int ver, const char *file_name, STATTYPE *buf) { #ifdef USE_XSTAT return STAT(zlib_real_lx)(ver, file_name, buf); #else return STAT(zlib_real_l)(file_name, buf); #endif } static inline int STAT(___zlibc_x)(int ver, const char *file_name, STATTYPE *buf) { #ifdef USE_XSTAT return STAT(zlib_real_x)(ver, file_name, buf); #else return STAT(zlib_real_)(file_name, buf ); #endif } zlibc-0.9k/mkinstalldirs0000555000076400001440000000121207306412072016052 0ustar aknaffusers00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Last modified: 1994-03-25 # Public domain errstatus=0 for file in ${1+"$@"} ; do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here zlibc-0.9k/Makefile.in0000644000076400001440000001250010210672040015304 0ustar aknaffusers00000000000000# # Makefile for Zlibc # # do not edit below this line # ============================================================================= SHELL = /bin/sh top_srcdir=@top_srcdir@ srcdir=@srcdir@ VPATH=@srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ infodir = @infodir@ mandir = @mandir@ libdir = @prefix@/lib CC = @CC@ CPPFLAGS = @CPPFLAGS@ DEFS = @DEFS@ HOST_ID = @HOST_ID@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ SHLIB = @SHLIB@ DEFS = @DEFS@ -DSYSCONFDIR=\"@sysconfdir@\" $(HOST_ID) SHAREDCFLAGS = -nostdlib -shared LN_S = @LN_S@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_INFO = @INSTALL_INFO@ MAKEINFO = makeinfo TEXI2DVI = texi2dvi TEXI2HTML = texi2html version=0.9k AIXLDFLAGS = -L. -bI:./syscall.exp -bnodelcsect -bnso -bI:/lib/syscalls.exp OBJECTS= open.o altnames.o access.o stat.o \ readdir.o readlink.o \ unlink.o rename.o \ chmod.o chown.o link.o \ symlink.o utime.o \ filetype.o zlibc.conf.o \ parseconfig.o strsep.o \ getxattr.o lgetxattr.o \ setxattr.o lsetxattr.o \ listxattr.o llistxattr.o \ removexattr.o lremovexattr.o CO_OBJECTS= compile_config.o printconfig.o strsep.o CFLAGS =@CFLAGS@ $(DEFS) -I. -I@srcdir@ -fpic MAN3=zlibc.3 MAN5=zlibc.conf.5 MAN1EXT = 1 MAN1DIR = $(mandir)/man${MAN1EXT} MAN3EXT = 3 MAN3DIR = $(mandir)/man${MAN3EXT} MAN5EXT = 5 MAN5DIR = $(mandir)/man${MAN5EXT} all: uncompress.so zlibc.3 zlibc.conf.5: zlibc.texi $(top_srcdir)/mkmanpages man: zlibc.3 zlibc.conf.5 $(OBJECTS) printconfig.o compile_config.o: \ zlibc.h config.h sysincludes.h params.h direct_sys.h stat.o: \ stat_tmpl.c stat.c readdir.o: \ readdir.c readdir_tmpl.c %.o: %.c zlibc.h config.h sysincludes.h params.h $(CC) $(CFLAGS) -c $< compile_config: $(CO_OBJECTS) $(CC) $(CFLAGS) -s -o $@ $(CO_OBJECTS) %.c: %.sample compile_config ./compile_config $< >$@ uncompress.so: $(OBJECTS) $(CC) -o $@ $(CFLAGS) $(SHAREDCFLAGS) $(OBJECTS) $(LIBS) -lc aix-uncompress.so: $(OBJECTS) aix-syscall.shr.o $(CC) -o $@ $(CFLAGS) $(SHAREDCFLAGS) $(OBJECTS) -lc $(AIXLDFAGS) %.exp: %.tmpl echo "#!`pwd`/aix-syscall.shr.o" > $@ cat $< >>$@ %.shr.o: %.o aix-syscall.exp ld -o $@ -bM:SRE -T512 -bE:aix-syscall.exp -bI:/lib/syscalls.exp -bnodelcsect $< mostlyclean: rm -f *. *~ image2 libimage jump_map \ subst_map image setaddress inject set_datastart library \ testfile zlibc.conf.c \ compile_config config.c libtype libstart libstart2 $(OBJECTS) clean: mostlyclean rm -f uncompress.so \ zlibc.so zlibc.dvi *.html *.info* texclean: -rm zlibc.aux zlibc.toc zlibc.log -rm zlibc.cps zlibc.pgs zlibc.vrs $(OBJECTS): zlibc.h config.h info: zlibc.info %.info: %.texi $(MAKEINFO) -I$(srcdir) $< --no-split --output=$@ dvi: zlibc.dvi %.dvi: %.texi $(TEXI2DVI) $< html: zlibc.html zlibc_toc.html %.html %_toc.html: %.texi $(TEXI2HTML) $< # Don't cd, to avoid breaking install-sh references. install-info: info $(top_srcdir)/mkinstalldirs $(infodir) if test -f zlibc.info; then \ for i in zlibc.info*; do \ $(INSTALL_DATA) $$i $(infodir)/$$i; \ done; \ else \ for i in $(srcdir)/zlibc.info*; do \ $(INSTALL_DATA) $$i $(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \ done; \ fi; \ if [ -n "$(INSTALL_INFO)" ] ; then \ if [ -f $(infodir)/dir.info ] ; then \ $(INSTALL_INFO) $(infodir)/zlibc.info $(infodir)/dir.info; \ fi; \ if [ -f $(infodir)/dir ] ; then \ $(INSTALL_INFO) $(infodir)/zlibc.info $(infodir)/dir; \ fi; \ fi uninstall-info: cd $(infodir) && rm -f zlibc.info* install: $(libdir)/uncompress.so install-man \ install-info install-bin uninstall: uninstall-bin uninstall-man uninstall-links distclean: clean rm -f config.cache config.h config.status config.log Makefile maintainer-clean: distclean $(libdir)/uncompress.so: uncompress.so rm $(libdir)/old-uncompress.so || true 2>/dev/null ln $(libdir)/uncompress.so $(libdir)/old-uncompress.so || true 2>/dev/null $(top_srcdir)/mkinstalldirs $(libdir) rm $(libdir)/uncompress-$(version).so || true 2>/dev/null $(INSTALL_PROGRAM) uncompress.so $(libdir)/uncompress-$(version).so ln -f $(libdir)/uncompress-$(version).so $(libdir)/uncompress.so chmod 4755 $(libdir)/uncompress-$(version).so install-bin: $(libdir)/uncompress.so install-man: @$(top_srcdir)/mkinstalldirs $(MAN1DIR) @for j in $(MAN1); do \ $(INSTALL_DATA) $(srcdir)/$$j $(MAN1DIR)/$$j ; \ echo $(MAN1DIR)/$$j ; \ done @$(top_srcdir)/mkinstalldirs $(MAN3DIR) @for j in $(MAN3); do \ $(INSTALL_DATA) $(srcdir)/$$j $(MAN3DIR)/$$j ; \ echo $(MAN3DIR)/$$j ; \ done @$(top_srcdir)/mkinstalldirs $(MAN5DIR) @for j in $(MAN5); do \ $(INSTALL_DATA) $(srcdir)/$$j $(MAN5DIR)/$$j ; \ echo $(MAN5DIR)/$$j ; \ done uninstall-man: @for j in $(MAN1); do \ rm -f $(MAN1DIR)/$$j ; \ echo $(MAN1DIR)/$$j ; \ done @for j in $(MAN3); do \ rm -f $(MAN3DIR)/$$j ; \ echo $(MAN3DIR)/$$j ; \ done @for j in $(MAN5); do \ rm -f $(MAN5DIR)/$$j ; \ echo $(MAN5DIR)/$$j ; \ done uninstall-links: @for j in $(LINKS); \ do rm -f $(bindir)/$$j ; \ echo $(bindir)/$$j ; \ done uninstall-lib: rm $(libdir)/uncompress.so $(libdir)/uncompress-$(version).so depend: $(SRCS) makedepend -- $(CFLAGS) -- $^ check: echo No self tests included # check target needed even if empty, in order to make life easyer for # automatic tools to install GNU soft zlibc-0.9k/aix-syscall.tmpl0000444000076400001440000000026007306412072016375 0ustar aknaffusers00000000000000real_access real_chmod real_chown real_getdents real_link real_lstat real_open real_readdir real_readlink real_rename real_stat real_symlink real_unlink real_utime real_utimes zlibc-0.9k/direct_sys.h0000444000076400001440000001207710206053036015572 0ustar aknaffusers00000000000000#ifndef ZLIBC_DIRECT_SYS_H #define ZLIBC_DIRECT_SYS_H #if defined RTLD_NEXT && defined __ELF__ extern int (*zlib_real_access)(const char *, int); extern int (*zlib_real_chmod) (const char *, mode_t); extern int (*zlib_real_chown) (const char *, uid_t, gid_t); extern int (*zlib_real_getdents) (unsigned int, struct dirent *, unsigned int); #ifdef SYS_getdents64 extern int (*zlib_real_getdents64) (unsigned int, struct dirent64 *, unsigned int); #endif extern int (*zlib_real_link) (const char *, const char *); extern int (*zlib_real_open) (const char *, int, mode_t); #ifdef linux extern FILE* (*zlib_real_fopen) (const char *, const char *mode); extern FILE* (*zlib_real_fopen64) (const char *, const char *mode); #endif extern int (*zlib_real_prev_stat) (const char *, struct stat *); extern struct dirent *(*zlib_real_readdir) (DIR *); # ifdef HAVE_READDIR64 extern struct dirent64 *(*zlib_real_readdir64) (DIR *); # endif extern int (*zlib_real_readlink) (const char *, char *, size_t); extern int (*zlib_real_rename) (const char *, const char *); # ifdef HAVE___XSTAT extern int (*zlib_real_xstat) (int vers, const char *, struct stat *); extern int (*zlib_real_lxstat) (int vers, const char *, struct stat *); # else extern int (*zlib_real_stat) (const char *, struct stat *); extern int (*zlib_real_lstat) (const char *, struct stat *); # endif # ifdef HAVE___XSTAT64 extern int (*zlib_real_xstat64) (int vers, const char *, struct stat64 *); extern int (*zlib_real_lxstat64) (int vers, const char *, struct stat64 *); # elif defined HAVE_STAT64 extern int (*zlib_real_stat64) (const char *, struct stat64 *); extern int (*zlib_real_lstat64) (const char *, struct stat64 *); # endif extern int (*zlib_real_symlink) (const char *, const char *); extern int (*zlib_real_unlink) (const char *); extern int (*zlib_real_utime) (const char *, struct utimbuf *); extern int (*zlib_real_utimes) (const char *, struct timeval *); #ifdef HAVE_GETXATTR extern ssize_t (*zlib_real_getxattr) (const char *, const char *, void *, size_t); extern ssize_t (*zlib_real_lgetxattr) (const char *, const char *, void *, size_t); extern int (*zlib_real_setxattr) (const char *, const char *, const void *, size_t, int); extern int (*zlib_real_lsetxattr) (const char *, const char *, const void *, size_t, int); extern ssize_t (*zlib_real_listxattr) (const char *, char *, size_t); extern ssize_t (*zlib_real_llistxattr) (const char *, char *, size_t); extern int (*zlib_real_removexattr) (const char *, const char *); extern int (*zlib_real_lremovexattr) (const char *, const char *); #endif #else /* RTLD_NEXT */ #ifdef aix #include "aix-syscall.h" #else /* aix */ #define zlib_real_access(fn, mode) (syscall(SYS_access, (fn), (mode))) #define zlib_real_chmod(fn, mode) (syscall(SYS_chmod,(fn), (mode))) #define zlib_real_chown(fn, owner, group) (syscall(SYS_chown,(fn),(owner),(group))) #define zlib_real_getdents(fd, dirp, count) (syscall(SYS_getdents, (fd), (dirp), (count))) #ifdef SYS_getdents64 #define zlib_real_getdents64(fd, dirp, count) (syscall(SYS_getdents64, (fd), (dirp), (count))) #endif #define zlib_real_link(fn1, fn2) (syscall(SYS_link, (fn1), (fn2))) #define zlib_real_lstat(fn, buf ) (syscall(SYS_lstat, (fn), (buf))) #define zlib_real_open(fn,flags,mode) (syscall(SYS_open, (fn), (flags), (mode))) #ifdef linux struct dirent *__libc_readdir(DIR * dir); #define zlib_real_readdir(dir) (__libc_readdir(dirp)) #else #define zlib_real_readdir(dirp) ((struct dirent *)syscall(SYS_readdir,(dirp))) /* if needed define SYS_readdir so that readdir gets compiled */ #endif #define zlib_real_readlink(fn,buf,len) (syscall(SYS_readlink, (fn), (buf), (len))) #define zlib_real_rename(fn1, fn2) (syscall(SYS_rename, (fn1), (fn2))) #define zlib_real_stat(fn, buf ) (syscall(SYS_stat, (fn), (buf))) #define zlib_real_symlink(fn1, fn2) (syscall(SYS_symlink, (fn1), (fn2))) #define zlib_real_unlink(fn) (syscall(SYS_unlink, (fn))) #define zlib_real_utime(fn, buf) (syscall(SYS_utime, (fn), (buf))) #define zlib_real_utimes(fn, buf) (syscall(SYS_utimes, (fn), (buf))) #ifdef HAVE_GETXATTR #define zlib_real_getxattr(fn,name,value,size) (syscall(SYS_getxattr, (fn), (name), (value), (size))) #define zlib_real_lgetxattr(fn,name,value,size) (syscall(SYS_lgetxattr, (fn), (name), (value), (size))) #define zlib_real_setxattr(fn,name,value,size,flags) (syscall(SYS_setxattr, (fn), (name), (value), (size), (flags))) #define zlib_real_lsetxattr(fn,name,value,size,flags) (syscall(SYS_lsetxattr, (fn), (name), (value), (size), (flags))) #define zlib_real_listxattr(fn,list,size) (syscall(SYS_listxattr, (fn), (list), (size))) #define zlib_real_llistxattr(fn,list,size) (syscall(SYS_llistxattr, (fn), (list), (size))) #define zlib_real_removexattr(fn,name) (syscall(SYS_removexattr,(fn),(name))) #define zlib_real_lremovexattr(fn,name) (syscall(SYS_lremovexattr,(fn),(name))) #endif #ifdef linux /* java */ int __libc_read(); int __libc_close(); #define read(a,b,c) __libc_read(a,b,c) #define close(a) __libc_close(a) #define write(a,b,c) __libc_read(a,b,c) #endif /* linux */ #endif /* aix */ #endif /* RTLD_NEXT */ #endif /* ZLIBC_DIRECT_SYS_H */ zlibc-0.9k/parseconfig.c0000444000076400001440000003435610205737530015730 0ustar aknaffusers00000000000000/* * parseconfig.c * * Copyright (C) 1993, 1994 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #define BUFLEN 1024 #define MAX_FA_SIZE 100 #define TK_NONE 0 #define TK_STRING 1 #define TK_COMMANDS 2 #define TK_USE 3 #define TK_CLASS 4 /* begin of a class definition */ #define TK_END 5 #define TK_DEFAULT 6 #define TK_NO_TOKEN 7 #define TK_EOL 8 #define TOK_VALUE 0xfff #define TOK_PREFIX (~TOK_VALUE) #define FA_BASE 0x1000 #define CM_BASE 0x2000 #define NCM_BASE 0x3000 #define PM_BASE 0x4000 #define TK_CM(a) ( CM_BASE | (a) ) #define TK_NCM(a) ( NCM_BASE | (a) ) #define TK_FA(a) ( FA_BASE | (a) ) #define TK_PM(a) ( PM_BASE | (a) ) static struct token_table { char *name; int value; } token_table[]={ { "commands", TK_COMMANDS }, { "command", TK_COMMANDS }, { "use", TK_USE }, { "uses", TK_USE }, { "class", TK_CLASS }, { "end", TK_END }, { "default", TK_DEFAULT }, { "all", TK_FA( FA_ALL2) }, { "dir", TK_FA( FA_DIR) }, { "directory", TK_FA( FA_DIR) }, { "subdir", TK_FA (FA_SUBDIR) }, { "subdirectory", TK_FA (FA_SUBDIR) }, { "basename", TK_FA ( FA_BASENAME) }, { "suffix", TK_FA ( FA_SUFFIX) }, { "filename", TK_FA ( FA_FILENAME) }, { "filesystem", TK_FA ( FA_FS) }, { "use_tmp_file", TK_PM( PM_USE_TMP_FILE ) }, { "hide_pipe", TK_PM( PM_HIDE_PIPE ) }, { "use_and_hide_pipe", TK_PM( PM_HIDE_PIPE ) }, { "show_pipe", TK_PM ( PM_SHOW_PIPE ) }, { "use_and_show_pipe", TK_PM ( PM_SHOW_PIPE ) }, { "dir_leave_compressed", TK_PM ( PM_DIR_LEAVE_COMPR ) }, { "leave_compressed", TK_PM ( PM_LEAVE_COMPR ) }, { "create_compressed", TK_PM(PM_CREATE_COMPR) }, { "no_create_compressed", TK_PM(PM_NOCREATE_COMPR) }, { "append_compressed", TK_PM(PM_APPEND_COMPR) }, { "no_append_compressed", TK_PM(PM_NOAPPEND_COMPR) }, { "uncompress_before_write", TK_PM(PM_NO_UNCOMPR_BEFORE_WRITE) }, { "no_uncompress_before_write", TK_PM(PM_UNCOMPR_BEFORE_WRITE) }, { "show_compressed_size", TK_PM(PM_SIZE_COMPR) }, { "show_uncompressed_size", TK_PM(PM_SIZE_UNCOMPR) }, { "disable", TK_CM ( CM_DISAB ) }, { "disable_child", TK_CM ( CM_DISAB_CHILD ) }, { "readdir_compr", TK_CM ( CM_READDIR_COMPR ) }, { "readdir", TK_CM ( CM_READDIR_COMPR ) }, { "verbose", TK_CM ( CM_VERBOSE ) }, { "unlink", TK_CM ( CM_UNLINK ) }, { "enable", TK_NCM ( CM_DISAB ) }, { "enable_child", TK_CM ( CM_DISAB_CHILD ) }, { "readdir_uncompr", TK_NCM ( CM_READDIR_COMPR ) }, { "silent", TK_NCM ( CM_VERBOSE ) }, { "no_unlink", TK_NCM ( CM_UNLINK ) }, { 0, TK_NO_TOKEN } }; #define E_NOT_FOUND 0 #define E_EXP_STR -1 #define E_EXP_FA -2 #define E_EXP_PM -3 #define E_EXP_EOL -4 #define E_SHORT -5 #define E_BAD_TOK -6 #define E_OOM -7 #define E_FA_TOO_BIG -8 #define E_EOF_REACHED -9 #define E_COM_FOL_FA -10 #define E_NO_CLASS -11 #define E_TWICE -12 #ifndef CONFIG_COMPILER static #endif char *err_strings[]={ "Record not found", "String expected", "File action expected", "Pipe mode expected", "End of line expected", "End of line reached", "Bad token", "Out of memory", "Too many filename actions", "End of file reached", "Commands clause following file-actions clause", "Undefined command class", "Same command listed twice" }; static char *mystrsep(char **stringp, const char *delim) { char *sp; const char *dp; sp = *stringp; if(!sp || !*sp) return 0; while(**stringp) { for(dp=delim; *dp; dp++) if(*dp == **stringp) { **stringp = '\0'; (*stringp)++; return sp; } (*stringp)++; } return sp; } static char *mymalloc(size_t size) { /* lightweight malloc. Avoids memory allocation in low level layers. */ static char buffer[256]; static int offset=0; char *ptr; if ( offset + size > 256 ) return (char *)malloc(size); ptr = buffer+offset; offset += size; return ptr; } static int my_strcmp(char *pattern, char *tok) { while(1){ if (! *pattern && ! *tok) return 0; if (*pattern == *tok){ tok++; pattern++; continue; } if (*pattern == '-' || *pattern == '_'){ if (*tok == '-' || *tok == '_') tok++; pattern++; continue; } return 1; } } static int get_next_token(char **stringp, char **val) { int stringmode; struct token_table *tok; char *delim; while(1) { if (! *stringp ) return TK_EOL; switch ( **stringp ){ case '#': return TK_EOL; case '"': stringmode = 1; (*stringp)++; delim= "\"\n"; break; case '\'': stringmode = 1; (*stringp)++; delim = "\'\n"; break; default: stringmode = 0; delim = "\n\t;, #"; } *val = mystrsep( stringp, delim ) ; if ( *val == 0 ) return TK_EOL; if ( **val == 0 ) continue; if ( !stringmode ){ tok = token_table; while ( tok->name && my_strcmp( tok->name, *val ) ) tok++; return tok->value; } return TK_STRING; } } static int parse_commands_line(char *prgname, char *stringp, char *class, int *mode, int *modemask) { int have_found; char *string; int tok; int stop_loop; #ifdef CONFIG_COMPILER int ret; commands_line *ptr; commands_line *cmd; cmd = 0; generation++; #endif have_found = 0; stop_loop = 0; while( ! stop_loop ){ switch( tok = get_next_token( & stringp, & string) ){ case TK_STRING: #ifdef CONFIG_COMPILER have_found = 1; if((ret=add_prog(&cmd,string))) return ret; #else if ( strcmp( string, prgname) == 0 ) have_found = 1; #endif break; case TK_DEFAULT: #ifdef CONFIG_COMPILER if((ret=add_default(&cmd))) return ret; #endif have_found = 1; break; case TK_USE: if (!have_found ) return 0; stop_loop = 1; break; case TK_EOL: return E_EXP_EOL; default: return E_BAD_TOK; } } while ( 1 ){ switch( tok = get_next_token( & stringp, & string) ){ case TK_STRING: #ifndef CONFIG_COMPILER if ( class[0] == '\0' ) strncpy( class, string, 16 ); #else for(ptr=cmd; ptr; ptr = ptr->localnext) if ( !ptr->class[0]) strncpy(ptr->class, string,16); #endif break; case TK_EOL: return 0; default: if ( (tok & ~TOK_VALUE) == CM_BASE ){ #ifdef CONFIG_COMPILER for(ptr=cmd; ptr; ptr = ptr->localnext) ptr->mode |= ( tok & TOK_VALUE ) & ~ptr->modemask; #else *mode |= ( tok & TOK_VALUE ) & ~*modemask; #endif } else if ((tok & ~TOK_VALUE) == NCM_BASE) { #ifdef CONFIG_COMPILER for(ptr=cmd; ptr; ptr = ptr->localnext) ptr->modemask |= tok & TOK_VALUE; #else *modemask |= tok & TOK_VALUE; #endif } else return E_BAD_TOK; break; } } } #ifdef CONFIG_COMPILER #define ___zlibc_nativestat(name,buf) stat(name,buf) #else #include "stat.h" #endif static int parse_fa_line(char *stringp, FilenameActions *fa ) { int have_found; char *string; int tok1, tok2, tok3; int stop_loop; int len=0; have_found = 0; stop_loop = 0; tok1 = tok2 = tok3 = TK_NONE; tok1 = get_next_token( & stringp, & string); if ( tok1 == TK_EOL) return 2; if ( ( tok1 & ~TOK_VALUE ) == PM_BASE ){ tok3 = tok1; tok2 = TK_STRING; tok1 = TK_FA ( FA_ALL ); if ( !fa ) return 1; } if ( tok1 == TK_DEFAULT ) { tok2 = TK_STRING; tok1 = TK_FA ( FA_ALL ); if ( !fa ) return 1; } if ( tok1 == TK_FA(FA_ALL2)) tok2 = TK_STRING; if ( !fa ) return 0; if ( tok1 == TK_STRING ){ tok2 = tok1; len = strlen ( string ); if ( string[0] == '.' ) tok1 = TK_FA ( FA_SUFFIX ); else if ( string[0] == '/' ){ if ( string[ len - 1] == '/' ) tok1 = TK_FA (FA_SUBDIR ); else tok1 = TK_FA ( FA_FILENAME); } else tok1 = TK_FA ( FA_BASENAME ); } if ( ( tok1 & ~TOK_VALUE ) != FA_BASE ) return E_EXP_FA; if ( tok2 == TK_NONE ){ tok2 = get_next_token( & stringp, & string); if ( tok2 != TK_STRING ) return E_EXP_STR; /* copy it */ len = strlen (string ); } fa->fa_type = tok1 & TOK_VALUE; fa->is_initialized = 0; if (tok1 != TK_FA (FA_ALL) && tok1 != TK_FA(FA_ALL2)){ if ( tok1 == TK_FA ( FA_SUBDIR ) || tok1 == TK_FA (FA_DIR ) ) { /* add a trailing slash if necessary */ if ( string[len-1] != '/' ){ string[len]= '/'; /* overwrite the trailing 0 character */ len++; } } if (tok1 != TK_FA( FA_FS)){ fa->name = (char *)mymalloc ( len + 1); if ( fa->name == 0 ) return E_OOM; fa->namelength = len; strncpy( fa->name, string, len ); fa->name[len]='\0'; } else { struct stat buf; int st; int olderrno; olderrno = errno; st = ___zlibc_nativestat(string, &buf); errno = olderrno; if (st==0){ fa->dev = buf.st_dev; if(strcmp(string,"/")){ char tmp[MAXPATHLEN+4]; strcpy(tmp, string); strcat(tmp, "/.."); st = ___zlibc_nativestat(tmp, &buf ); if (st < 0 || buf.st_dev == fa->dev) fa->namelength = 0; } } else fa->dev = 0; } } if ( !tok3 ){ tok3 = get_next_token( & stringp, & string); if ( (tok3 & ~TOK_VALUE) != PM_BASE ) return E_EXP_PM; } fa->pipe_mode = tok3 & TOK_VALUE ; if ( get_next_token ( & stringp, & string) != TK_EOL ) return E_EXP_EOL; if (fa->fa_type == FA_ALL) return 1; return 0; } static FilenameActions userFilenameActions[MAX_FA_SIZE]; #define ST_CM 1 #define ST_FA 2 static int parse_class(FILE *f,int *line, FilenameActions *fa) { char buffer[BUFLEN]; char *stringp; int count; int ret; count = 0; while ( 1 ){ if ( fgets( buffer, BUFLEN, f) == 0 ) return E_EOF_REACHED; (*line)++; stringp = buffer; ret = parse_fa_line( buffer, fa ); if (ret==2) continue; if ( ret ) return ret; if ( fa ){ fa++; count++; } if ( count > MAX_FA_SIZE ) return E_FA_TOO_BIG; } } #ifndef CONFIG_COMPILER static #endif int parse_file(char *progname, FILE *f, int *line, int *mode, int *modemask, char *classname) { char buffer[BUFLEN]; int state=ST_CM; char *stringp, *string; int ret, tok; FilenameActions *fa; *line = 0; while ( 1){ if ( fgets( buffer, BUFLEN, f) == 0 ) return 0; (*line)++; stringp = buffer; tok = get_next_token ( & stringp, & string); if ( tok == TK_EOL ) continue; if ( tok == TK_COMMANDS ){ if ( state == ST_FA ) return E_COM_FOL_FA; ret= parse_commands_line(progname, stringp, classname, mode, modemask ); if ( ret <0) return ret; continue; } if ( tok == TK_CLASS ){ state = ST_FA; #ifndef CONFIG_COMPILER if ( classname[0] == '\0' ) return 0; if ( ( classname[0] == '\0' ) || (*modemask & CM_HAVE_FA) ) /* we have already the file actions */ return 0; #endif tok = get_next_token ( & stringp, & string); if ( tok != TK_STRING ) return E_EXP_STR; #ifndef CONFIG_COMPILER if ( strcmp ( string, classname ) ) /* not equal */ fa = 0; else #endif fa = userFilenameActions; ret = parse_class(f, line, fa ); if ( ret < 0 ) return ret; #ifndef CONFIG_COMPILER if ( fa ){ *modemask |= CM_HAVE_FA; return 0; } #else print_class(fa, string,*line); #endif continue; } return E_BAD_TOK; } } extern int zlib_mode; void zlib_getuserconf(char *progname, FilenameActions **filenameActions, int *mode, int *modemask) { int line; int ret; int i; FILE *f; char classname[BUFLEN]; #ifdef HOMECONF char homeconffile[MAXPATHLEN + 1 + sizeof( HOMECONF ) ]; struct passwd *pw; uid_t uid; char *homedir; char *username; int iamnotsuid; #endif char *conffiles[3]; int nconffiles=0; #ifndef SECURITY conffiles[0] = getenv("LD_ZLIB_CONFFILE"); if ( conffiles[0] ) nconffiles++; #endif #ifdef HOMECONF uid = geteuid(); #ifndef SECURITY iamnotsuid = (getuid() == uid || getgid() == getegid()); #else iamnotsuid = 0; #endif if (iamnotsuid) homedir = getenv ("HOME"); else homedir = 0; /* first we call getlogin. There might be several accounts sharing one uid */ if ( !homedir){ pw = 0; if (iamnotsuid) username = getenv("LOGNAME"); else username = 0; if ( !username ) username = getlogin(); if ( username ) pw = getpwnam( username); if ( pw == 0 || pw->pw_uid != uid) /* if we can't getlogin, look up the pwent by uid */ pw = getpwuid(uid); /* we might still get no entry */ if ( pw ) homedir = pw->pw_dir; } if ( homedir ){ strncpy(homeconffile, homedir, MAXPATHLEN ); homeconffile[MAXPATHLEN]='\0'; #ifdef __GNUC__ strcat(homeconffile,"/" HOMECONF ); #else strcat(homeconffile,"/" ); strcat(homeconffile, HOMECONF ); #endif conffiles[ nconffiles++ ] = homeconffile; } #endif conffiles[ nconffiles++] = SYSCONFDIR "/zlibc.conf"; if ( zlib_mode & CM_VERBOSE ){ for ( i=0; i < nconffiles; i++ ) fprintf(stderr,"%s\n", conffiles[i] ); } /* in case there were no files */ ret = -1; classname[0]='\0'; for ( i=0; i< nconffiles; i++){ f = fopen(conffiles[i], "r" ); if ( f == 0 ) continue; ret = parse_file(progname,f, &line, mode, modemask, classname); fclose(f); if ( ret < 0 ){ if ( zlib_mode & CM_VERBOSE ) fprintf(stderr, "zlibc: %s in line %d, file %s\n", err_strings[ -ret], line, conffiles[i]); /* skip this file and fall back to the next one */ continue; } if ( *modemask == CM_ALL_MODES ) break; } if ( zlib_mode & CM_VERBOSE ){ i=0; if ( (*modemask) & CM_HAVE_FA ){ fprintf(stderr,"Listing class\n"); while ( userFilenameActions[i].fa_type != FA_ALL ){ fprintf(stderr,"%x %d %d", userFilenameActions[i].fa_type, userFilenameActions[i].pipe_mode, userFilenameActions[i].namelength); if(userFilenameActions[i].name) fprintf(stderr," %s", userFilenameActions[i].name); printf("\n"); i++; } } else if ( classname[0] ) fprintf(stderr, "Trying to use undefined class \"%s\"\n", classname); fprintf(stderr,"%x %d default\n", userFilenameActions[i].fa_type, userFilenameActions[i].pipe_mode); } *filenameActions = userFilenameActions; } zlibc-0.9k/readlink.c0000444000076400001440000000205707620267751015224 0ustar aknaffusers00000000000000/* * readlink.c * * Copyright (C) 1993 Alain Knaff */ #define readlink x #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #undef readlink int readlink(__const char *file_name, char *buf, size_t len) { int st; int olderrno; _zlibc_init(); st = zlib_real_readlink(file_name,buf,len); if ( st >= 0 || errno != ENOENT ) return st; { char newname[MAXPATHLEN + MAXEXTLEN + 1]; olderrno = errno; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"readlinking %s\n", file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); st = zlib_real_readlink(newname, buf, len); if ( st < 0 ){ errno = olderrno; return st; } if(!strncmp(buf + st - zlib_extlen, zlib_ext, zlib_extlen)) buf[st-zlib_extlen] = 0; /* the file exists with z extension, ignore error */ errno=0; return st; } } zlibc-0.9k/link.c0000444000076400001440000000140007620267751014357 0ustar aknaffusers00000000000000/* * link.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" int link(__const char *file_name1, __const char *file_name2) { int st; char newname1[MAXPATHLEN + MAXEXTLEN + 1]; char newname2[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st = zlib_real_link(file_name1, file_name2); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name1,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; strncpy(newname1,file_name1,1024); strcat(newname1,zlib_ext); strncpy(newname2,file_name2,1024); strcat(newname2,zlib_ext); errno = 0; return zlib_real_link(newname1, newname2); } zlibc-0.9k/config.h.in0000644000076400001440000001403710210161546015275 0ustar aknaffusers00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* Define this if you want configuration using environmental variables */ #undef ENV_CONF /* Define to 1 if you have the header file. */ #undef HAVE_ANSIDECL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the `fchdir' function. */ #undef HAVE_FCHDIR /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FEATURES_H /* Define to 1 if you have the `getxattr' function. */ #undef HAVE_GETXATTR /* Define to 1 if you have the header file. */ #undef HAVE_GNU_STABS_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the `sun' library (-lsun). */ #undef HAVE_LIBSUN /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* 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, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_PWD_H /* Define to 1 if you have the `readdir64' function. */ #undef HAVE_READDIR64 /* Define to 1 if you have the `stat64' function. */ #undef HAVE_STAT64 /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* 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 `strpbrk' function. */ #undef HAVE_STRPBRK /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP /* Define to 1 if you have the header file. */ #undef HAVE_SYSCALL_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_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_SYSCALL_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 the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME /* Define to 1 if you have the `utimes' function. */ #undef HAVE_UTIMES /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if you have the `_xstat' function. */ #undef HAVE__XSTAT /* Define to 1 if you have the `_xstat64' function. */ #undef HAVE__XSTAT64 /* Define to 1 if you have the `__access' function. */ #undef HAVE___ACCESS /* Define to 1 if you have the `__chmod' function. */ #undef HAVE___CHMOD /* Define to 1 if you have the `__chown' function. */ #undef HAVE___CHOWN /* Define to 1 if you have the `__libc_open' function. */ #undef HAVE___LIBC_OPEN /* Define to 1 if you have the `__link' function. */ #undef HAVE___LINK /* Define to 1 if you have the `__lstat' function. */ #undef HAVE___LSTAT /* Define to 1 if you have the `__open' function. */ #undef HAVE___OPEN /* Define to 1 if you have the `__readlink' function. */ #undef HAVE___READLINK /* Define to 1 if you have the `__symlink' function. */ #undef HAVE___SYMLINK /* Define to 1 if you have the `__unlink' function. */ #undef HAVE___UNLINK /* Define to 1 if you have the `__xstat' function. */ #undef HAVE___XSTAT /* Define to 1 if you have the `__xstat64' function. */ #undef HAVE___XSTAT64 /* 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 this if you want runtime configuration using .zlibrc */ #undef RUNTIME_CONF /* 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 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `long' if does not define. */ #undef off_t /* Define to `unsigned' if does not define. */ #undef size_t zlibc-0.9k/filetype.c0000444000076400001440000003504310206053053015233 0ustar aknaffusers00000000000000 /* * filetype.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #include "stat.h" static int is_initialised=0; static FilenameActions *filenameActions; static char *default_uncompressor[]= { UNCOMPR, 0 }; #ifndef SECURITY static char *custom_uncompressor[]= { 0, 0 }; #endif char *zlib_ext; int zlib_extlen; int zlib_mode; char *zlib_tmp; char **zlib_uncompressor; #define ENV_PREFIX "LD_ZLIB_" extern char **environ; /** * Remove LD_PRELOAD=uncompress.o from environment in case CM_DISAB_CHILDREN * is set * We cannot use putenv or setenv here, because they work on a copy of the * environment, which will be overwritten between the time this _init is * called, and main is called */ static void remove_ld_preload() { if(zlib_mode & CM_DISAB_CHILD) { char preload_name[]="LD_PRELOAD="; char *uncompr = "/uncompress.o"; int i; for(i=0; environ[i]; i++) { if(!strncmp(environ[i], preload_name, sizeof(preload_name)-1)) { /* strip out all items contains "uncompress.o" from LD_PRELOAD var */ char *rptr = environ[i] + sizeof(preload_name) - 1; char *lastbegin=rptr; char *wptr = rptr; int comp=1; int atbegin=1; lastbegin = wptr; while(1) { if(*rptr == ':') { if(uncompr[comp] == '\0') { wptr = lastbegin; if(atbegin) { rptr++; comp=1; continue; } } comp = 1; lastbegin = wptr; atbegin=0; } else if(*rptr == '\0') { if(uncompr[comp] == '\0') { wptr = lastbegin; } *wptr='\0'; break; } else if(*rptr == uncompr[comp]) { comp++; } else { comp=0; } *wptr++=*rptr++; } } } } } static char *mode_table[] = { "DISABLE", "READDIR_COMPR", "VERBOSE", "UNLINK", "NOCONF"}; void zlib_initialise(void) { int modemask; int olderrno; #ifndef SECURITY unsigned int i; char env_buffer[1024]; char *value; #endif olderrno = errno; if ( !is_initialised ){ CommandActions *cma; #ifdef HAVE_PROC char static_cmdline[1025]; int fd,n; #endif char *cmdline; char *progname=0; zlib_mode = modemask = 0; zlib_ext = EXT; zlib_extlen = strlen(zlib_ext); zlib_uncompressor = default_uncompressor; zlib_tmp = TMP; #ifndef SECURITY if (getuid() == geteuid() || getgid() == getegid()){ zlib_tmp = getenv("LD_ZLIB_TMP"); if ( zlib_tmp == 0 ) zlib_tmp = TMP; zlib_ext= getenv("LD_ZLIB_EXT"); if ( zlib_ext == 0 ) zlib_ext = EXT; zlib_extlen = strlen(zlib_ext); if ( zlib_extlen > MAXEXTLEN ){ fprintf(stderr,"extension too long, taking default\n"); zlib_ext = EXT; } custom_uncompressor[0] = getenv("LD_ZLIB_UNCOMPRESSOR"); if ( custom_uncompressor[0] ){ zlib_uncompressor = custom_uncompressor; } else zlib_uncompressor = default_uncompressor; strcpy(env_buffer, ENV_PREFIX); for ( i=0; i< ( sizeof(mode_table) / sizeof(char *) ); i++){ strcpy( env_buffer+(sizeof( ENV_PREFIX ) - 1 ), mode_table[i] ); if ( (value=getenv ( env_buffer )) ){ if ( ( strcmp( value, "on" ) == 0 ) || ( strcmp( value, "1" ) == 0 )){ zlib_mode |= ( 1 << ( i + 1 )); }else if ( ( strcmp( value, "off" ) ) && ( strcmp( value, "0" ) )) continue; modemask |= ( 1 << ( i + 1 )); } } if ( zlib_mode & CM_DISAB){ is_initialised = 2; errno = olderrno; return; } } #endif #ifdef HAVE_PROC /* get command line */ cmdline=static_cmdline; strcpy(cmdline, "unknown"); fd=syscall(SYS_open,"/proc/self/cmdline", O_RDONLY); if ( fd > 0 ){ cmdline[1024]='\0'; n = read( fd, cmdline,1024 ); if ( n < 1 ) cmdline[0] = '\0'; else cmdline[n] = '\0'; close(fd); } else { #endif /* where does the command line live on a sun ? */ /* horrible undocumented kludge... This might even work on a proc-less * linux*/ do { int zerosfound; if ( environ == 0 ){ cmdline=""; break; } cmdline = *environ; if ( cmdline == 0 ){ cmdline=""; break; } zerosfound = 0; while(zerosfound < 2 ){ cmdline--; if ( *cmdline == 0 ) zerosfound++; else zerosfound = 0; } cmdline +=2; } while(0); } progname = strrchr(cmdline, '/' ); if ( !progname ) progname = cmdline; else progname++; if ( zlib_mode & CM_VERBOSE) fprintf(stderr,"progname = %s\n",progname); is_initialised = 1; /* get user configuration */ #ifndef NO_RT_CONF if ( ! ( zlib_mode & CM_NORTCONF ) ) zlib_getuserconf(progname, &filenameActions, &zlib_mode, &modemask); #endif if ( modemask != CM_ALL_MODES ){ /* if we couldn't get the user configuration, use compiled in defaults */ cma = zlib_commandActions; while ( cma->name && strcmp(cma->name, progname ) ) cma++; if ( ( modemask & CM_HAVE_FA ) == 0 ) filenameActions = cma->actions; zlib_mode |= ( cma->cm_type & ~modemask); } remove_ld_preload(); is_initialised = 2; /* initialisation completely done */ } errno = olderrno; } #ifdef __ELF__ #ifdef RTLD_NEXT int (*zlib_real_access)(const char *, int); int (*zlib_real_chmod) (const char *, mode_t); int (*zlib_real_chown) (const char *, uid_t, gid_t); int (*zlib_real_getdents) (unsigned int, struct dirent *, unsigned int); #ifdef SYS_getdents64 int (*zlib_real_getdents64) (unsigned int, struct dirent64 *, unsigned int); #endif int (*zlib_real_link) (const char *, const char *); int (*zlib_real_open) (const char *, int, mode_t); #ifdef linux FILE *(*zlib_real_fopen) (const char *, const char *); FILE *(*zlib_real_fopen64) (const char *, const char *); #endif struct dirent *(*zlib_real_readdir) (DIR *); struct dirent64 *(*zlib_real_readdir64) (DIR *); int (*zlib_real_readlink) (const char *, char *, size_t); int (*zlib_real_rename) (const char *, const char *); # ifdef HAVE___XSTAT int (*zlib_real_xstat) (int vers, const char *, struct stat *); int (*zlib_real_lxstat) (int vers, const char *, struct stat *); # else int (*zlib_real_stat) (const char *, struct stat *); int (*zlib_real_lstat) (const char *, struct stat *); # endif # ifdef HAVE___XSTAT64 int (*zlib_real_xstat64) (int vers, const char *, struct stat64 *); int (*zlib_real_lxstat64) (int vers, const char *, struct stat64 *); # elif defined HAVE_STAT64 int (*zlib_real_stat64) (const char *, struct stat64 *); int (*zlib_real_lstat64) (const char *, struct stat64 *); # endif int (*zlib_real_symlink) (const char *, const char *); int (*zlib_real_unlink) (const char *); int (*zlib_real_utime) (const char *, struct utimbuf *); int (*zlib_real_utimes) (const char *, struct timeval *); #ifdef HAVE_GETXATTR ssize_t (*zlib_real_getxattr) (const char *, const char *, void *, size_t); ssize_t (*zlib_real_lgetxattr) (const char *, const char *, void *, size_t); int (*zlib_real_setxattr) (const char *, const char *, const void *, size_t, int); int (*zlib_real_lsetxattr) (const char *, const char *, const void *, size_t, int); ssize_t (*zlib_real_listxattr) (const char *, char *, size_t); ssize_t (*zlib_real_llistxattr) (const char *, char *, size_t); int (*zlib_real_removexattr) (const char *, const char *); int (*zlib_real_lremovexattr) (const char *, const char *); #endif #endif static int _is_rtld_initialized = 0; int _zlibc_init(void) { if(_is_rtld_initialized) { return 0; } _is_rtld_initialized=1; #ifdef RTLD_NEXT zlib_real_access = dlsym(RTLD_NEXT, "access"); zlib_real_chmod = dlsym(RTLD_NEXT, "chmod"); zlib_real_chown = dlsym(RTLD_NEXT, "chown"); zlib_real_getdents = dlsym(RTLD_NEXT, "_getdents"); #ifdef SYS_getdents64 zlib_real_getdents64 = dlsym(RTLD_NEXT, "_getdents64"); #endif zlib_real_link = dlsym(RTLD_NEXT, "link"); # ifdef HAVE___LIBC_OPEN zlib_real_open = dlsym(RTLD_NEXT, "__libc_open"); # else zlib_real_open = dlsym(RTLD_NEXT, "_open"); # endif if(zlib_real_open == NULL) zlib_real_open = dlsym(RTLD_NEXT, "open"); #ifdef linux zlib_real_fopen = dlsym(RTLD_NEXT, "fopen"); zlib_real_fopen64 = dlsym(RTLD_NEXT, "fopen64"); #endif zlib_real_readdir = dlsym(RTLD_NEXT, "readdir"); zlib_real_readdir64 = dlsym(RTLD_NEXT, "readdir64"); zlib_real_readlink = dlsym(RTLD_NEXT, "readlink"); zlib_real_rename = dlsym(RTLD_NEXT, "rename"); zlib_real_symlink = dlsym(RTLD_NEXT, "symlink"); zlib_real_unlink = dlsym(RTLD_NEXT, "unlink"); zlib_real_utime = dlsym(RTLD_NEXT, "utime"); zlib_real_utimes = dlsym(RTLD_NEXT, "utimes"); # ifdef HAVE___XSTAT zlib_real_xstat = dlsym(RTLD_NEXT, "__xstat"); zlib_real_lxstat = dlsym(RTLD_NEXT, "__lxstat"); # else zlib_real_stat = dlsym(RTLD_NEXT, "stat"); zlib_real_lstat = dlsym(RTLD_NEXT, "lstat"); # endif # ifdef HAVE___XSTAT64 zlib_real_xstat64 = dlsym(RTLD_NEXT, "__xstat64"); zlib_real_lxstat64 = dlsym(RTLD_NEXT, "__lxstat64"); # elif defined HAVE_STAT64 zlib_real_stat64 = dlsym(RTLD_NEXT, "stat64"); zlib_real_lstat64 = dlsym(RTLD_NEXT, "lstat64"); # endif #endif #ifdef HAVE_GETXATTR zlib_real_getxattr = dlsym(RTLD_NEXT, "getxattr"); zlib_real_lgetxattr = dlsym(RTLD_NEXT, "lgetxattr"); zlib_real_setxattr = dlsym(RTLD_NEXT, "setxattr"); zlib_real_lsetxattr = dlsym(RTLD_NEXT, "lsetxattr"); zlib_real_listxattr = dlsym(RTLD_NEXT, "listxattr"); zlib_real_llistxattr = dlsym(RTLD_NEXT, "llistxattr"); zlib_real_removexattr = dlsym(RTLD_NEXT, "removexattr"); zlib_real_lremovexattr = dlsym(RTLD_NEXT, "lremovexattr"); #endif zlib_initialise(); return 0; } #endif static int masks[]= { PM_READ_MASK, PM_CREATE_MASK, PM_APPEND_MASK, PM_UNCOMPR_MASK, PM_SIZE_COMPR_MASK }; #define NUMBER(x) (sizeof(x) / sizeof(*(x))) static void quick_stat(__const char *name, dev_t *dev, ino_t *ino) { int olderrno; int st; struct stat buf; olderrno = errno; st = ___zlibc_nativestat(name, &buf); errno = olderrno; if ( st < 0 ) { /* file not found */ *ino = 0; *dev = 0; } else { *dev = buf.st_dev; *ino = buf.st_ino; } } static void initialize_fa(FilenameActions *fa) { if(fa->is_initialized) return; fa->is_initialized = 1; quick_stat(fa->name, &fa->dev, &fa->ino); } static int check_subdir(__const char *name, int dirlength, int fd, FilenameActions *fa, int subdir) { char dirname[MAXPATHLEN+1]; struct stat buf; dev_t last_dev=0; ino_t last_ino=0; int cwd; int cfd; int closefd=0; /* fd must be closed on exit */ int r; initialize_fa(fa); if(!fa->ino) return 0; if(fd == -1){ if(dirlength - 1 > MAXPATHLEN) return 0; if(!dirlength) strcpy(dirname,"."); else strncpy(dirname,name, dirlength-1); closefd = fd = zlib_real_open(dirname, O_RDONLY, 0); if(fd < 0) return 0; } cwd = -1; cfd = fd; while(1) { fstat(cfd, &buf); if(cwd >= 0) close(cfd); if(buf.st_dev == fa->dev && buf.st_ino == fa->ino) { r = 1; break; } if(!subdir) { r = 0; break; } if(cwd >= 0 && buf.st_dev == last_dev && buf.st_ino == last_ino) { /* root reached */ r = 0; break; } last_dev = buf.st_dev; last_ino = buf.st_ino; #ifdef HAVE_FCHDIR if(cwd < 0) { /* remember old directory */ cwd = zlib_real_open(".", O_RDONLY, 0); if(cwd < 0) { r = 0; break; } fchdir(fd); /* go to the new directory */ } chdir(".."); /* move up one level */ cfd = zlib_real_open(".", O_RDONLY, 0); if(cfd < 0) { r = 0; break; } #else if(fd != -1) { /* unknown filename */ r = 0; break; } if(strlen(dirname) > MAXPATHLEN - 3) { r = 0; /* filename too long */ break; } strcat(dirname, "/.."); cfd = zlib_real_open(dirname, O_RDONLY, 0); if(cfd < 0) { r = 0; break; } #endif } #ifdef HAVE_FCHDIR if(cwd != -1) { /* revert back to real current directory */ fchdir(cwd); close(cwd); } #endif if(closefd) close(fd); return r; } int zlib_getfiletype(__const char *name, int fd) { __const char *basename; FilenameActions *fa; int length; int dirlength; int basenamelength; int pipe_mode; unsigned int i; int match; int dostop; int dev; struct stat buf; int olderrno; int st; /* preprocessing */ dev=-1; basename = strrchr( name, '/' ); if ( !basename ) basename = name; else basename++; dirlength = basename - name; basenamelength = strlen(basename); length = dirlength + basenamelength; zlib_initialise(); if ( is_initialised == 1 ) /* transition period, loading user supplied defaults */ return PM_SHOW_PIPE; fa = filenameActions; pipe_mode=0; while ( 1 ){ match=0; switch( fa->fa_type ){ /* before calling strncmp, the length are compared in order to speed up * the search. In most cases, the length doesn't match, this way we don't * need a costly call to strncmp */ case FA_ALL: case FA_ALL2: match=1; break; case FA_DIR: if(fd == -1 && name[0] == '/') match= fa->namelength == dirlength && !strncmp(fa->name, name, dirlength); else match = check_subdir(name, dirlength, fd, fa, 0); break; case FA_SUBDIR: if(fd == -1 && name[0] == '/') match= fa->namelength<=dirlength && !strncmp(fa->name,name,fa->namelength); else match = check_subdir(name, dirlength, fd, fa, 1); break; case FA_BASENAME: match= fa->namelength == basenamelength && !strcmp(fa->name, basename); break; case FA_FILENAME: match= fa->namelength == length && !strcmp(fa->name, name); break; case FA_SUFFIX: match= fa->namelength <= basenamelength && !strcmp(fa->name, basename + (basenamelength - fa->namelength)); break; case FA_FS: if ( dev == -1 ){ olderrno = errno; if ( fd != -1 ) st = fstat(fd,&buf); else { char namez[MAXPATHLEN + MAXEXTLEN + 1]; strncpy(namez, name, MAXPATHLEN); strncat(namez, zlib_ext, MAXPATHLEN); st = ___zlibc_nativestat(namez, &buf ); } errno = olderrno; if ( st < 0 ) dev = 0; else dev = buf.st_dev; } match = buf.st_dev == fa->namelength; break; default: fprintf(stderr,"Error in filenameActions %x in %d\n", fa->fa_type, (int) getpid()); sleep(3); return 0; break; } if (match){ dostop=1; for (i=0; i< NUMBER(masks); i++){ if (!(pipe_mode & masks[i])) pipe_mode |= fa->pipe_mode & masks[i]; if (!(pipe_mode & masks[i])) dostop=0; } if ( dostop || fa->fa_type == FA_ALL){ #ifdef DEBUG fprintf(stderr,"pm=%x\n", pipe_mode); #endif return pipe_mode; } } fa++; } } zlibc-0.9k/open.c0000444000076400001440000002021410206053113014342 0ustar aknaffusers00000000000000/* * open.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" static char *zlib_compressor[]= { COMPR, 0 }; #ifdef HAVE___LIBC_OPEN int __libc_open(__const char *pathname, int flags, mode_t mode); #define open __libc_open /*ALIASF2(open, __libc_open, int, mode_t);*/ #endif #include int open(__const char *name, int flags, mode_t mode); int open64 (__const char *name, int flags, ...) { va_list ap; va_start(ap, flags); if(flags & O_CREAT) { mode_t mode = va_arg(ap, mode_t); return open(name, flags | O_LARGEFILE, mode); } else { return open(name, flags | O_LARGEFILE, 0); } } int open(__const char *name, int flags, mode_t mode) { int fd; int zfd; int pid; int filetype; int zflags; int do_append; int do_uncompress; int do_create; int have_filetype; int tmp; int stat_result; int status; struct stat buf; #ifdef SYS_UTIME struct utimbuf buf2; #else # ifdef SYS_UTIMES struct timeval buf2[2]; # endif #endif int pipeout[2]; char newname[MAXPATHLEN + MAXEXTLEN + 1]; char _pname[MAXPATHLEN + MAXEXTLEN + 1]; __const char *pname; _zlibc_init(); filetype=have_filetype=do_append=do_uncompress=do_create=0; zflags = flags; if (flags & O_CREAT){ zlib_initialise(); have_filetype=1; if ( ! (zlib_mode & CM_DISAB )){ filetype = zlib_getfiletype(name,-1); if ((flags & O_ACCMODE) == O_WRONLY && (flags & (O_TRUNC | O_EXCL)) && (filetype & PM_CREATE_COMPR)) do_create = 1; else if ((flags & O_ACCMODE) == O_WRONLY && (flags & O_APPEND) && (filetype & PM_APPEND_COMPR)) do_append=1; else if ((flags & O_ACCMODE ) != O_RDONLY && (filetype & PM_UNCOMPR_BEFORE_WRITE)) do_uncompress=1; if (do_create | do_append | do_uncompress) zflags &= ~O_CREAT; } } fd = zlib_real_open(name,zflags,mode); #ifdef DEBUG fprintf(stderr,"file opened *: %s %d %x %x %d\n", name,fd, flags, zflags, errno); #endif /* success to open uncompressed file */ if ( fd >= 0 || errno != ENOENT ) return fd; if (!have_filetype) zlib_initialise(); if ( zlib_mode & CM_DISAB ) return fd; if (!have_filetype) filetype = zlib_getfiletype(name,-1); if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"opening %s %o\n", name,flags); strncpy(newname,name,MAXPATHLEN); strcat(newname,zlib_ext); /* open compressed file */ zflags = flags; if ((flags & O_ACCMODE) == O_WRONLY && (flags & O_TRUNC) && (filetype & PM_CREATE_COMPR)) do_create = 1; else if ((flags & O_ACCMODE) == O_WRONLY && (flags & O_APPEND) && (filetype & PM_APPEND_COMPR)) do_append=1; else if ((flags & O_ACCMODE ) != O_RDONLY && (filetype & PM_UNCOMPR_BEFORE_WRITE)){ zflags = O_RDONLY; do_uncompress=1; } else if ((flags & O_ACCMODE) != O_RDONLY) return fd; zfd = zlib_real_open(newname,zflags,mode); if ( zfd < 0 ){ if ( flags & O_CREAT ) return zlib_real_open(name,flags,mode); if ( errno == EINVAL ) /* don't want to replace perm errors */ errno = ENOENT; return zfd; } if (do_append || do_create){ /* make a pipe */ if(pipe(pipeout) < 0 ) return -1; /* double fork */ switch(pid=fork()){ case 0: /* son */ switch(fork()){ case 0: /* son of son */ if (zfd == 0){ /* shit happens ... */ tmp = dup(zfd); close(zfd); zfd = tmp; } if (pipeout[0] != 0){ close(0); dup(pipeout[0]); } if ( zfd != 1 ){ close(1); dup(zfd); /* compressed file, input */ } close(pipeout[0]); close(pipeout[1]); if(! (zlib_mode & CM_VERBOSE)) close(2); execvp (zlib_compressor[0], zlib_compressor); if ( zlib_mode & CM_VERBOSE ){ perror("exec compressor"); exit(1); } case -1: /* error */ if ( zlib_mode & CM_VERBOSE ) perror("fork error"); exit(1); default: /* father */ exit(0); /* son of son will be taken over by init */ } case -1: /* error */ errno = ENOENT; return -1; } close(pipeout[0]); /* close read end of pipe */ close(zfd); /* close raw compressed file */ fd=dup(pipeout[1]); close(pipeout[1]); /*wait4(pid,&status,0,0); wait for son */ wait(&status); return fd; } if (!do_uncompress && (filetype & PM_READ_MASK) >= PM_HIDE_PIPE ){ /* make a pipe */ if(pipe(pipeout) < 0 ) return -1; /* double fork */ switch(pid=fork()){ case 0: /* son */ switch(fork()){ case 0: /* son of son */ if ( zfd != 0 ){ close(0); dup(zfd); /* compressed file, input */ } if ( pipeout[1] != 1 ){ close(1); dup(pipeout[1]); } close(pipeout[0]); close(pipeout[1]); if(! (zlib_mode & CM_VERBOSE)) close(2); execvp ( zlib_uncompressor[0], zlib_uncompressor ); if ( zlib_mode & CM_VERBOSE ){ perror("exec uncompressor"); exit(1); } case -1: /* error */ if ( zlib_mode & CM_VERBOSE ) perror("fork error"); exit(1); default: /* father */ exit(0); /* son of son will be taken over by init */ } case -1: /* error */ errno = ENOENT; return -1; } close(pipeout[1]); /* close write end of pipe */ close(zfd); /* close raw compressed file */ fd=dup(pipeout[0]); close(pipeout[0]); wait(&status); } else { stat_result=fstat(zfd, &buf); mode = 0400; if ( !do_uncompress){ sprintf(_pname,"%s/pipe.%d",zlib_tmp,(int)getpid()); pname = _pname; } else { mode = 0; pname = name; } zlib_real_unlink(pname); pipeout[0]=zlib_real_open(pname, O_RDWR | O_CREAT | O_EXCL, mode); /* temporary output file */ if ( pipeout[0] < 0 ){ if ( zlib_mode & CM_VERBOSE ) perror("could not create uncompressed file"); errno = ENOENT; return -1; } switch(pid=fork()){ case 0: /* son */ if ( zfd != 0 ){ close(0); dup(zfd); /* compressed file, input */ } if ( pipeout[0] != 1 ){ close(1); dup(pipeout[0]); } if(! (zlib_mode & CM_VERBOSE)) close(2); execvp ( zlib_uncompressor[0], zlib_uncompressor ) ; if ( zlib_mode & CM_VERBOSE ) perror("exec uncompressor"); exit(1); case -1: /* error */ errno = ENOENT; return -1; } wait(&status); /* touch it */ close(pipeout[0]); if(do_uncompress){ /* restore the original mode */ if ( stat_result >= 0) mode = buf.st_mode; else mode = 0600; zlib_real_chmod(pname, mode); } if ( stat_result >= 0 ){ #ifdef SYS_UTIME buf2.actime = buf.st_atime; buf2.modtime = buf.st_mtime; zlib_real_utime(pname, &buf2); #else # ifdef SYS_UTIMES buf2[0].tv_sec = buf.st_atime; buf2[0].tv_usec = 0; buf2[1].tv_sec = buf.st_mtime; buf2[1].tv_usec = 0; zlib_real_utimes(pname, buf2); # endif #endif } close(zfd); /* close raw compressed file */ /* re-open it */ fd=zlib_real_open(pname, flags, mode); if ( !do_uncompress) zlib_real_unlink(pname); else { if ( fd>=0 && WIFEXITED(status) && WEXITSTATUS(status)==0 ) /* only erase the original file if nothing looks fishy... */ zlib_real_unlink(newname); } } return fd; } #undef creat int creat(__const char *name, mode_t mode) { return open(name, O_CREAT | O_WRONLY | O_TRUNC, mode); } #ifdef linux FILE *fopen(const char *path, const char *mode) { FILE *f; int fd; _zlibc_init(); f=zlib_real_fopen(path, mode); if(f != NULL) return f; if ( zlib_mode & CM_DISAB ) /* ZLIBC disabled */ return NULL; if(strcmp(mode, "r")) /* If mode is anything else than read, don't bother */ return NULL; fd = open(path, O_RDONLY, 0); if(fd < 0) return NULL; return fdopen(fd, mode); } FILE *fopen64(const char *path, const char *mode) { FILE *f; int fd; _zlibc_init(); f=zlib_real_fopen64(path, mode); if(f != NULL) return f; if ( zlib_mode & CM_DISAB ) /* ZLIBC disabled */ return NULL; if(strcmp(mode, "r")) /* If mode is anything else than read, don't bother */ return NULL; fd = open(path, O_RDONLY, 0); if(fd < 0) return NULL; return fdopen(fd, mode); } #endif zlibc-0.9k/Changelog.txt0000444000076400001440000000116510210165454015700 0ustar aknaffusers00000000000000zlibc_20050226 Renamed uncompress.o into uncompress.so just like all the other shared libraries Did away with statically linked recovery tools: no longer needed nowadays, where we install using LD_PRELOAD Fixed readdir on Solaris zlibc_20050220b Implemented fopen() stub, to make it work again with more programs in Linux zlibc_20050220 Fixed Solaris compatibility zlibc_20050213 Fixed open64 prototype so that it compiles again with newer glibc Fixed filetype so that it uses "open" if "__libc_open" is not available zlibc_20040228 Makefile fixes (duplicate infodir, prefix for /lib) zlibc_20030525 Misc typo fixes zlibc-0.9k/strip-pp.sed0000444000076400001440000000007107306412072015521 0ustar aknaffusers00000000000000:1 /^\.[IP]P$/N s/^\.[IP]P\n\(\.[ITP]P\)$/\1/ /^\.PP$/b1 zlibc-0.9k/syscalls0000444000076400001440000000020507306412072015025 0ustar aknaffusers00000000000000___access ___chmod ___chown ___lstat ___open _readdir ___readlink _rename ___stat ___unlink ___symlink ___link _utime _creat __end__ zlibc-0.9k/params.h.in0000444000076400001440000000033607306412072015313 0ustar aknaffusers00000000000000#define PREFIX "@prefix@" #define EXT "@with_ext@" #define TMP "@with_tmpdir@" #define MAXEXTLEN @with_extlen@ #define UNCOMPR "@uncompressor@" #define COMPR "@compressor@" @define_have_proc@ #define HOMECONF ".zlibrc" zlibc-0.9k/stat.c0000444000076400001440000000341110206046665014372 0ustar aknaffusers00000000000000/* * stat.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #include #define STAT(x) x ## stat #define STATTYPE struct stat #ifdef HAVE___XSTAT # ifdef solaris # define fSTAT _fxstat(ver, fd, buf) # else # define fSTAT __fxstat(ver, fd, buf) # endif #else # define fSTAT fstat(fd, buf) #endif #include "stat_tmpl.c" #undef STAT #undef STATTYPE #undef fSTAT #ifdef HAVE_STAT64 # define STATTYPE struct stat64 # define STAT(x) x##stat64 # ifdef HAVE___XSTAT64 # define fSTAT __fxstat64(ver,fd,buf) # else # define fSTAT fstat64(fd, buf) # endif # include "stat_tmpl.c" #undef STAT #undef STATTYPE #undef fSTAT #endif #ifdef HAVE___XSTAT int __xstat(int vers, __const char *name, struct stat *buf) { _zlibc_init(); return zlibc_xstat(vers, name, buf); } int __lxstat (int vers, const char *name, struct stat *buf) { _zlibc_init(); return zlibc_lxstat(vers, name, buf); } # ifdef HAVE___XSTAT64 int __xstat64(int vers, const char *name, struct stat64 *buf) { _zlibc_init(); return zlibc_xstat64(vers, name, buf); } int __lxstat64 (int vers, const char *name, struct stat64 *buf) { _zlibc_init(); return zlibc_lxstat64(vers, name, buf); } # endif #else /* no xstat */ int stat(__const char *name, struct stat *buf) { _zlibc_init(); return zlibc_stat(name, buf); } int lstat(__const char *name, struct stat *buf) { _zlibc_init(); return zlibc_lstat(name, buf); } #endif # ifdef HAVE_STAT64 int stat64(__const char *name, struct stat64 *buf) { _zlibc_init(); return zlibc_xstat64(_STAT_VER, name, buf); } int lstat64(__const char *name, struct stat64 *buf) { _zlibc_init(); return zlibc_lxstat64(_STAT_VER,name, buf); } # endif zlibc-0.9k/stat.h0000444000076400001440000000112410205723432014367 0ustar aknaffusers00000000000000/** * Stat wrappers for zlibc's own usage, i.e. when zlibc itself wants * to probe existence or attributes of a file, rather than just * proxying a request from an application */ static inline int ___zlibc_testexistence(__const char *name) { struct stat buf; #ifdef HAVE___XSTAT return zlib_real_lxstat(_STAT_VER, name, &buf); #else return zlib_real_lstat(file_name, &buf); #endif } static inline int ___zlibc_nativestat(__const char *name, struct stat *buf) { #ifdef HAVE___XSTAT return zlib_real_xstat(_STAT_VER, name, buf); #else return zlib_real_stat(file_name, buf); #endif } zlibc-0.9k/version0000444000076400001440000000000407306412072014652 0ustar aknaffusers000000000000000.9 zlibc-0.9k/printconfig.c0000444000076400001440000001335207306730177015753 0ustar aknaffusers00000000000000#define CONFIG_COMPILER /* * parseconfig.c * * Copyright (C) 1994 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #define E_NOT_FOUND 0 #define E_EXP_STR -1 #define E_EXP_FA -2 #define E_EXP_PM -3 #define E_EXP_EOL -4 #define E_SHORT -5 #define E_BAD_TOK -6 #define E_OOM -7 #define E_FA_TOO_BIG -8 #define E_EOF_REACHED -9 #define E_COM_FOL_FA -10 #define E_NO_CLASS -11 #define E_TWICE -12 commands_line *commands_lines; int generation=0; int zlib_mode=0; commands_line *make_entry(char *name) { commands_line *ptr,*newptr; for(ptr = commands_lines; ptr; ptr=ptr->globalnext){ if (! strcmp(ptr->name, name) ) return ptr; } newptr = (commands_line *) malloc(sizeof(commands_line)); if (!newptr){ fprintf(stderr,"Out of memory\n"); exit(1); return 0; } newptr->globalnext = commands_lines; commands_lines = newptr; newptr->name = (char *) malloc(strlen(name)+1); if(!newptr->name){ fprintf(stderr,"Out of memory\n"); exit(1); return 0; } strcpy(newptr->name, name); newptr->mode = 0; newptr->modemask = 0; newptr->generation = 0; newptr->localnext = 0; newptr->class[0]='\0'; newptr->defined = 0; return newptr; } commands_line *default_cl=0; int add_prog(commands_line **cmd, char *name) { commands_line *ptr; ptr = make_entry(name); if( !ptr) return E_OOM; default_cl = ptr; if(ptr->generation == generation) return E_TWICE; ptr->localnext = *cmd; *cmd = ptr; return 0; } int add_default(commands_line **cmd) { commands_line *ptr; ptr = make_entry(""); if(!ptr) return E_OOM; if(ptr->generation == generation) return E_TWICE; ptr->localnext = *cmd; *cmd = ptr; return 0; } #define PRINT(x) case x: printf(#x); break #define PRINT2(x) case x: if(notfirst)putchar('|');printf(#x); notfirst=1;break void print_class(FilenameActions *fa, char *name, int line) { int i; int notfirst; commands_line *ptr; int needed; needed = 0; for(ptr = commands_lines; ptr; ptr=ptr->globalnext){ if ( ! strcmp ( ptr->class, name )){ if ( ptr->defined ){ fprintf(stderr, "Class %s defined twice!\n", name); exit(1); } needed = 1; ptr->defined = 1; } } if (!needed ) return; printf("static FilenameActions zlibc_class_%s[]={\n", name); while(1) { if ( fa->fa_type == FA_FS ){ #if 0 printf("FSREC( "); printf("FA_FS,\t0x%x", fa->namelength); #else fprintf(stderr, "Skipping filesystem criterion in class %s near line %d\n", name, line); fa++; continue; #endif } else { printf("FREC( "); if ( fa->fa_type == FA_ALL) fa->namelength=0; switch(fa->fa_type){ PRINT(FA_ALL); PRINT(FA_DIR); PRINT(FA_SUBDIR); PRINT(FA_BASENAME); PRINT(FA_SUFFIX); PRINT(FA_ALL2); } if( fa->fa_type != FA_FS){ printf(",\t\""); for(i=0; i < fa->namelength; i++) putchar(fa->name[i]); putchar('"'); } } printf(",\t"); if ( fa->pipe_mode == PM_NONE ) printf("PM_NONE"); else { notfirst=0; switch(fa->pipe_mode & PM_READ_MASK){ PRINT2(PM_USE_TMP_FILE); PRINT2(PM_HIDE_PIPE); PRINT2(PM_SHOW_PIPE); PRINT2(PM_DIR_LEAVE_COMPR); PRINT2(PM_LEAVE_COMPR); } switch(fa->pipe_mode & PM_CREATE_MASK){ PRINT2(PM_CREATE_COMPR); PRINT2(PM_NOCREATE_COMPR); } switch(fa->pipe_mode & PM_APPEND_MASK){ PRINT2(PM_APPEND_COMPR); PRINT2(PM_NOAPPEND_COMPR); } switch(fa->pipe_mode & PM_UNCOMPR_MASK){ PRINT2(PM_UNCOMPR_BEFORE_WRITE); PRINT2(PM_NO_UNCOMPR_BEFORE_WRITE); } switch(fa->pipe_mode & PM_SIZE_COMPR){ PRINT2(PM_SIZE_COMPR); PRINT2(PM_SIZE_UNCOMPR); } } printf(")"); if ( fa->fa_type == FA_ALL ){ printf("};\n\n"); break; } else printf(",\n"); fa++; } } #define PRINT3(x) if(ptr->mode&x){if(notfirst)putchar('|');printf(#x);notfirst=1;} void print_commands_line(commands_line *ptr, int end) { int notfirst; notfirst=0; printf("{ "); if(ptr->name[0]) printf("\"%s\"",ptr->name); else putchar('0'); printf(",\t"); if ( !ptr->mode) printf("0"); else { PRINT3(CM_DISAB); PRINT3(CM_DISAB_CHILD); PRINT3(CM_READDIR_COMPR); PRINT3(CM_VERBOSE); PRINT3(CM_UNLINK); PRINT3(CM_NORTCONF); } printf(",\t"); if(ptr->class && ptr->class[0]){ if ( !ptr->defined ){ fprintf(stderr,"Class %s undefined (needed by %s)\n", ptr->class, ptr->name); exit(1); } printf("zlibc_class_%s", ptr->class); } else if ( default_cl && default_cl->class && default_cl->class[0] ) printf("zlibc_class_%s", default_cl->class); else { fprintf(stderr,"Missing default class\n"); exit(1); } putchar('}'); if(!end) putchar(','); putchar('\n'); } void print_commands_lines(void) { commands_line *ptr; commands_line *def; printf("\nCommandActions zlib_commandActions[]={\n"); def=0; for(ptr= commands_lines; ptr; ptr=ptr->globalnext){ if( ptr->name[0] == '\0' ) def = ptr; else print_commands_line(ptr,0); } if ( def) print_commands_line(def,1); else printf("0,0,0}\n"); printf("};\n"); } int main(int argc, char **argv) { int line; int ret; FILE *f; if ( argc == 1){ fprintf(stderr,"Usage: %s file\n", argv[0]); exit(1); } f=fopen(argv[1], "r"); if(!f){ perror("fopen"); exit(1); } printf("/* This file is generated automatically. DO NOT EDIT*/\n"); printf("#define _LARGEFILE64_SOURCE\n"); printf("#define _GNU_SOURCE\n"); printf("#include \"sysincludes.h\" \n"); ret=parse_file(0, f, &line,0,0,0); if ( ret < 0 ){ fprintf(stderr, "zlibc: %s in line %d\n", err_strings[ -ret], line); exit(1); } print_commands_lines(); return 0; } zlibc-0.9k/utime.c0000444000076400001440000000145007620267752014553 0ustar aknaffusers00000000000000/* * utime.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef SYS_UTIME int utime(__const char *file_name, __const struct utimbuf *buf) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_utime(file_name, buf); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Utiming %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; st=zlib_real_utime(newname, buf); if ( st < 0 && errno == EINVAL ) errno = ENOENT; return st; } #endif zlibc-0.9k/config.make.linux0000444000076400001440000000004707306412072016513 0ustar aknaffusers00000000000000CFLAGS1= TARGET=linuxelf-uncompress.o zlibc-0.9k/lgetxattr.c0000444000076400001440000000146107663770216015451 0ustar aknaffusers00000000000000/* * lsetxattr.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef HAVE_GETXATTR int lgetxattr(__const char *file_name, const char *name, void *value, size_t size) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_lgetxattr(file_name, name, value, size); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Getxattr %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_lgetxattr(newname, name, value, size); } #endif zlibc-0.9k/CHANGES0000644000076400001440000001317110210672027014244 0ustar aknaffusers00000000000000Version 0.9k ------------ - Updated for compatibility with Solaris 10 and current versions of Glibc Version 0.9j ------------ - Glibc 2.1 compatibility tested (gawd, when will this moving target ever stop?) - New disable_child mode: this disables zlibc for all programs started by covered commands (useful for emacs, so that any dired buffers show full filenames, rather than strip the .gz) Version 0.9i ------------ - Glibc compatibility tested Version 0.9h ------------ - Use RTLD_NEXT to call original syscalls on systems that support this. Version 0.9g ------------ - aliasing fixes Version 0.9f ------------ - Alias open to __open on Linux Version 0.9e ------------ - Close stderr when invoking gzip in order to avoid spurious 'broken pipe' error messages from gzip. Version 0.9c ------------- - Automatically generate manpages from texinfo doc Version 0.9b ------------ - Installation bug fixes Version 0.9 ----------- - Added texinfo doc - System-wide conf file is now /usr/local/etc/zlibc.conf (/etc/zlibc.conf on Linux) - Zlibc now has the same name everywhere: uncompress.o, and is installed in /usr/local/lib. Override if you use /etc/ld.so.preload on Linux. - Removed a.out support (for simplification) - Fixed my address - Use GNU autoconf for configuration - Added Solaris support Version 0.8 ----------- - More cleanup - Makefile bug fix - Use LD_ZLIB as a prefixe for env vars instead of just ZLIB for security reasons. Version 0.7 ----------- - Cleanup Version 0.6e ------------ - Fixed a.out preload library - Added a patch for the dynaminc linker, which allows to use preloaded objects with suid programs. Version 0.6d ------------ - Cleaned up version numbers - Updated compilation instruction for Suns Version 0.6c ------------ - Now works with the new binutils-2.5.2l.15 linker. - Can be compiled for a.out on a system with a compiler defaulting to ELF - documentation updated to reflect improvements in ld.so and ld-linux.so - works now with the new extensible xstat functions. - Updated instructions and FAQ Version 0.6b ------------ - Cleaned up version numbers Version 0.6a ------------ - Added a few missing files Version 0.6 ----------- - zlibc now works with ELF - all configuration by environmental variables is disabled if the effective uid doesn't match the real uid, or if the effective gid doesn't match the real gid. (This is to prevent abuse of suid/sgid binaries) - minor bugfixes - minor cleanups in the Makefiles Version 0.5 20November ----------------------- - Fixed strace incompatibility (Linux only) - upgraded to 4.6.20 Version 0.4d 10November ----------------------- - limited write support. (Compression after writing, complete decompression in place before writing, ...) - configuration files compilable to default configuration. - Non-ANSI compiler support dropped. - Sun and Linux Makefiles merged. Version 0.4b ------------ Version 0.4c ------------ Version 0.4a ------------ More bug fixes. - invoke all shell scripts with the name of the shell (For those Linux boxes where bash is not the default shell!) (thanks to Bill C. Riemers for reporting the bugs) - rewrote the getlibrary script to not use ls any more. (Color ls could cause us trouble) - added cp, cpio, pax and cpp to compiled-in defaults and zlibrc.sample (thanks to Bill C. Riemers for suggesting it) - polished up the documentation - replace EINVAL errno by ENOENT when the compressed files can not be found ( EINVAL gets generated when stating a filename with two dots in it on a dos fs. This screws up copying to a dos fs) (thanks to York Lam for suggesting this, and sending me a patch) - fixed a security hole in open.c. However, there are still many race conditions. Version 0.4 ----------- Mostly bug fixes and documentation: - made 'unlink' option the default behavior. ( thanks to cls@truffula.sj.ca.us for suggesting it) - use ldconfig in install.linux script, new naming convention (thanks to Bill C. Riemers for suggesting it) - don't use statically linked recovery programs. (Not necessary any more, now that I have ldconfig) - don't use uname in the configure script. Before, the configure script broke with old uname. (thanks to Joe Waters for reporting the bug) - fixed a Makefile bug that caused the 'library' file not to be remade when new libraries are installed. (thanks to Joe Waters for reporting the bug) - the configure script now says that it gets its default values out of the local configuration. (thanks to Joe Waters for suggesting it) - fixed HAVE_PROC bug (broke 'at' on linux) (thanks to Joe Waters for reporting the bug) - fixed readdir.c bug (broke 'du' on sun) (thanks to Andrew A. Burgess for reporting this bug) - changed open.c so that mtime and ctime are conserved when a file is uncompressed using tmpfiles. This is needed for NN's expire. (thanks to Andrew A. Burgess for suggesting it). Support for compressed read-write files will be added later. - included documentation in binary release. (thanks to Thomas Boutell for suggesting it) - added explanation to the manpage about what to do with symlinks. (thanks to Bernd Meyer and Ulrich Lauther for suggesting it) - removed experimental code from readlink and lstat. (Links to compressed files used to be shown as "|/file" ) - added FAQ, and improved documentation. zlibc-0.9k/zlibc.texi0000644000076400001440000013130410210675156015254 0ustar aknaffusers00000000000000\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename zlibc.info @settitle Zlibc @c UPDATE THIS DATE WHENEVER YOU MAKE CHANGES! @c For double-sided printing, uncomment: @c @setchapternewpage odd @setchapternewpage off @c %**end of header @c MANskip @set EDITION 0.9k @set VERSION 0.9k @set UPDATED February 2005 @iftex @finalout @end iftex @ifinfo @format START-INFO-DIR-ENTRY * Zlibc: (zlibc). Zlibc: transparently access compressed files. END-INFO-DIR-ENTRY @end format @end ifinfo @ifinfo Zlibc Copyright (C) 1993-1999 Alain Knaff Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one, and provided that the privacy of any reader of the resulting derived work is respected. In particular is it strictly forbidden to make this documentation available on a World Wide Web server which deals cookies. However, keeping access statistics is allowed. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end ifinfo @titlepage @title Zlibc @subtitle Transparently access compressed files. @subtitle Edition @value{EDITION}, for Zlibc version @value{VERSION} @subtitle @value{UPDATED} @author by Alain Knaff @page @vskip 0pt plus 1filll Copyright @copyright{} 1993-1999 Alain Knaff Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one and provided that the privacy of any reader of the resulting derived work is respected. In particular is it strictly forbidden to make this documentation available on a World Wide Web server which deals cookies. However, keeping access statistics is allowed. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end titlepage @ifinfo @node Top, Location, (dir), (dir) @end ifinfo @c MANend-skip @c zlibc-conf.5skip @ignore @unnumbered Name zlibc - transparently access compressed files. @end ignore @unnumbered Introduction The zlibc package allows transparent on the fly uncompression of gzipped files. Your programs will be able to access any compressed file, just as if they were uncompressed. Zlibc will transparently uncompresses the data from these files as soon as they are read, just as a compressed filesystem would do. No kernel patch, no recompilation of these executables and no recompilation of the libraries is needed. It is not (yet) possible execute compressed files with zlibc. However, there is another package, called @code{tcx}, which is able to uncompress executables on the fly. On the other hand @code{tcx} isn't able to uncompress data files on the fly. Fortunately, the both zlibc and tcx may coexist on the same machine without problems. @menu * Location:: Where to get zlibc and early bug fixes * Installing zlibc:: How to install zlibc * Using zlibc:: How to configure your system to use zlibc * How it works:: The general principles behind zlibc * Customization:: How to customize zlibc to your needs * Porting zlibc:: How to port zlibc to new architectures * Variable Index:: Variable Index * Concept Index:: Concept Index @end menu @c MANskip This documentation looks most pretty when printed or as html. Indeed, in the info version certain examples are difficult to read due to the confusing quoting conventions of info. @c MANend-skip @include man-warning.texi @cindex bugs @cindex ALPHA patches @cindex patches @cindex diffs @cindex mailing list @node Location, Installing zlibc, Top, Top @chapter Where to get zlibc Zlibc can be found at the following places (and their mirrors): @example ftp://zlibc.linux.lu/zlibc-0.9k.tar.gz ftp://www.tux.org/pub/knaff/zlibc/zlibc-0.9k.tar.gz ftp://ibiblio.unc.edu/pub/Linux/libs/compression/zlibc-0.9k.tar.gz ftp://ftp.gnu.org/gnu/zlibc/compression/zlibc-0.9k.tar.gz @end example Before reporting a bug, make sure that it has not yet been fixed in the Alpha patches which can be found at: @example http://zlibc.linux.lu/ http://www.tux.org/pub/knaff/zlibc @end example These patches are named @code{zlibc-}@var{version}@code{-}@var{ddmm}@code{.taz}, where version stands for the base version, @var{dd} for the day and @var{mm} for the month. Due to a lack of space, I usually leave only the most recent patch. There is an zlibc mailing list at zlibc @@ www.tux.org . Please send all bug reports to this list. You may subscribe to the list by sending a message with 'subscribe zlibc @@ www.tux.org' in its body to majordomo @@ www.tux.org . (N.B. Please remove the spaces around the "@@" both times. I left them there in order to fool spambots.) Announcements of new zlibc versions will also be sent to the list, in addition to the linux announce newsgroups. The mailing list is archived at http://www.tux.org/hypermail/zlibc/latest @node Installing zlibc, Using zlibc, Location, Top @chapter Installing zlibc @vindex LD_PRELOAD @cindex Installation @cindex Set-uid programs @cindex Boot problems @enumerate @item If you install zlibc on Linux, make sure that your shared loader (ld-linux.so.1/ld.so) understands @code{LD_PRELOAD}. (Best if ld.so-1.8.5 or more recent) @item Type @code{./configure}. This runs the GNU autoconfigure script which configures the @file{Makefile} and the @file{config.h} file. You may compile time configuration options to @code{./configure}, see for details. @item Type @code{make} to compile zlibc. @item Type @code{make install} to install zlibc and associated programs to its final target. @item To use this module, set the environment variable @code{LD_PRELOAD} to point to the object. Example (sh syntax): @example LD_PRELOAD=/usr/local/lib/uncompress.so export LD_PRELOAD @end example or (csh syntax): @example setenv LD_PRELOAD /usr/local/lib/uncompress.so @end example On linux, use /lib/uncompress.so instead of /usr/local/lib/uncompress.so . You might want to put these lines in your @file{.profile} or @file{.cshrc} in order to have the uncompressing functions available all the time. @item Compress your files using gzip and enjoy @end enumerate For security reasons, the dynamic loader disregards environmental variables such as @code{LD_PRELOAD} when executing set uid programs. However, on Linux, you can use zlibc with set uid programs too, by using one of the two methods described below: @enumerate @item You may ing the path to @file{uncompress.so} into @file{/etc/ld.so.preload} instead of using @code{LD_PRELOAD}. @strong{WARNING}: If you use @file{/etc/ld.so.preload}, be sure to install @file{uncompress.so} on your root filesystem, for instance in @code{/lib}, as is done by the default configuration. Using a directory which is not available at boot time, such as /usr/local/lib will cause trouble at the next reboot! It is also careful to remove zlibc from @file{/etc/ld.so.preload} when installing a new version. First test it out using @code{LD_PRELOAD}, and only if everything is ok, put it back into @file{/etc/ld.so.preload}. @item If you have a version of @code{ld.so} which is more recent than @code{1.9.0}, you can set @code{LD_PRELOAD} to just contain the basename of @file{uncompress.so} without the directory. In that case, the file is found as long as it is in the shared library path (which usually contains @file{/lib} and @file{/usr/lib})). Because the search is restricted to the library search path, this also works for set-uid programs. Example (sh syntax): @example LD_PRELOAD=uncompress.so export LD_PRELOAD @end example or (csh syntax): @example setenv LD_PRELOAD uncompress.so @end example The advantage of this approach over @file{ld.so.preload} is that zlibc can more easily be switched off in case something goes wrong. @end enumerate @node Using zlibc, How it works, Installing zlibc, Top @chapter Using zlibc @cindex Symbolic links Once zlibc is installed, simply compress your biggest datafiles using gzip. Your programs are now able to uncompress these files on the fly whenever they need them. @section Zlibc and links @subsection Symbolic links After compressing your datafiles, you also need to change any potential symbolic links pointing to them. Let's suppose that @file{x} is a symlink to @file{tstfil}: @example > echo 'this is a test' >tstfil > ln -s tstfil x > ls -l total 1 -rw-r--r-- 1 alknaff sirac 15 Feb 25 19:40 tstfil lrwxrwxrwx 1 alknaff sirac 8 Feb 25 19:40 x -> tstfil @end example After compressing it, you'll see the following listing: @example > gzip tstfil > ls -l total 1 pr--r--r-- 1 alknaff sirac 15 Feb 25 19:40 tstfil lrwxrwxrwx 1 alknaff sirac 8 Feb 25 19:40 x -> tstfil @end example @file{Tstfil} is now shown as a pipe by zlibc in order to warn programs that they cannot seek in it. Zlibc still shows it with its old name, and you can directly look at its contents: @example > cat tstfil this is a test @end example However, @file{tstfil} is not yet accessible using the symbolic link: @example > cat x cat: x: No such file or directory @end example In order to make @file{tstfil} accessible using the link, you have to destroy the link, and remake it: @example > rm x /bin/rm: remove `x'? y > ln -s tstfil x > ls -l total 1 pr--r--r-- 1 alknaff sirac 15 Feb 25 19:40 tstfil lrwxrwxrwx 1 alknaff sirac 8 Feb 25 19:44 x -> tstfil > cat x this is a test @end example @subsection Hard links If you compress datafiles with hard links pointing to them, gzip refuses to compress them. @example > echo 'this is a test' >tstfil > ln tstfil x > ls -li total 2 166 -rw-r--r-- 2 alknaff sirac 15 Feb 25 19:46 tstfil 166 -rw-r--r-- 2 alknaff sirac 15 Feb 25 19:46 x > gzip tstfil gzip: tstfil has 1 other link -- unchanged @end example Thus you need to remove these hard links first, and remake them after compressing the file. @example > rm x /bin/rm: remove `x'? y > gzip tstfil > ln tstfil x > ls -li total 2 167 pr--r--r-- 2 alknaff sirac 15 Feb 25 19:46 tstfil 167 pr--r--r-- 2 alknaff sirac 15 Feb 25 19:46 x > cat x this is a test @end example @node How it works, Customization, Using zlibc, Top @chapter How it works Usually, programs don't make system calls directly, but instead call a library function which performs the actual system calls. For instance, to open a file, the program first calls the @code{open} library function, and then this function makes the actual syscall. Zlibc overrides the @code{open} function and other related functions in order to do the uncompression on the fly. If the @code{open} system call fails because the file doesn't exist, zlibc constructs the filename of a compressed file by appending @code{.gz} to the filename supplied by the user program. If this compressed file exists, it is opened and piped trough @code{gunzip}, and the descriptor of the read end of this pipe is returned to the caller. In some cases, the compressed file is first uncompressed into a temporary file, and a read descriptor for this file is passed to the caller. This is necessary if the caller wants to call @code{lseek} on the file or @code{mmap} it. A description of data files for which using temporary is necessary can be given in the configuration files @file{/usr/local/etc/zlibc.conf} (@file{/etc/zlibc.conf} on Linux)@footnote{Actually the location of the system-wide include file depends on the settings of @code{sysconfdir} and @code{prefix} during @code{./configure} (@pxref{Compile-time configuration}).} and @file{~/.zlibrc}. @xref{Configuration files}, for a detailed description of their syntax. Many user programs try to check the existence of a given file by other system calls before actually opening it. That's why zlibc also overrides these system calls. If for example the user program tries to stat a file, this call is also intercepted. The compressed file, which exists physically on the disk, is also called 'the real file', and the uncompressed file, whose existence is only simulated by zlibc is called 'the virtual file'. @node Customization, Porting zlibc, How it works, Top @chapter Customization @cindex Customization The behavior of zlibc can be tailored using configuration files or environment variables. This customization should normally not be needed, as the compiled-in defaults are already pretty complete. @menu * Environmental variables:: * Configuration files:: * Compiled-in defaults:: * Compile-time configuration:: @end menu @node Environmental variables, Configuration files, Customization, Customization @section Environmental variables Environmental variables come in two kinds: @emph{switch} variables have a boolean value and can only be turned on or off, whereas @emph{string} variables can have arbitrary strings as values. @menu * Switch variables:: * String variables:: @end menu @node Switch variables, String variables, Environmental variables, Environmental variables @subsection Switch variables @vindex LD_ZLIB_VERBOSE @cindex debugging zlibc @vindex LD_ZLIB_UNLINK @cindex removing files @cindex preventing accidental removal of compressed files (env.var.) @vindex LD_ZLIB_DISABLE @vindex LD_ZLIB_READDIR_COMPR @cindex showing compressed files in a directory listing (env.var.) These variables represent a flag which can be turned on or off. If their value is @code{on} or @code{1} they are turned on, if their value is @code{off} or @code{0} they are turned off. All other values are ignored. If the same flag can be turned on or off using config files, the environmental variable always has the priority. @table @code @item LD_ZLIB_VERBOSE If this variable is turned on, informational messages are printed on many operations of zlibc. Moreover, error messages are printed in order to point out errors in the configuration files, if any. If this variable is turned off, errors are silently ignored. @item LD_ZLIB_UNLINK If this variable is turned on, and if the user program tries to unlink a virtual (uncompressed) file, zlibc translates this call into unlinking the real file. If this variable is turned off, unlink calls on virtual files are ignored. @item LD_ZLIB_DISABLE If this variable is turned on, zlibc is switched off. @item LD_ZLIB_READDIR_COMPR If this variable is turned on, the readdir function shows the real (compressed) files instead of the virtual (uncompressed) files. @end table @node String variables, , Switch variables, Environmental variables @subsection String variables @vindex LD_ZLIB_TMP @cindex directory for temporary files (env.var.) @vindex LD_ZLIB_EXT @cindex filename extension for compressed files (env.var.) @vindex LD_ZLIB_UNCOMPRESSOR @cindex command line for the uncompressing program (env.var.) @vindex LD_ZLIB_CONFFILE @cindex location of the configuration file (env.var.) These variables have a string value, which represent a file, a directory or a command. @table @code @item LD_ZLIB_TMP This is the name of the directory where the temporary uncompressed files are put. The default is /tmp. @item LD_ZLIB_EXT This is the extension which is appended to a virtual file name in order to obtain the real (compressed) file name. The default is @code{.gz}. @item LD_ZLIB_UNCOMPRESSOR This is the name of the program to be invoked to uncompress the data. Default is @code{gzip -dc}. @item LD_ZLIB_CONFFILE This is the name of an additional configuration file. If this variable is defined and if the corresponding file exists, the configuration described in this file overrides the configurations in @file{~/.zlibrc} and in @file{/usr/local/etc/zlibc.conf} (@file{/etc/zlibc.conf} on Linux). @end table @c zlibc.3skip @c zlibc-conf.5end-skip @c MANskip @node Configuration files, Compiled-in defaults, Environmental variables, Customization @section Configuration files @cindex Processing order of configuration file. @c MANend-skip @ignore @subsection Name zlibc.conf - zlibc's configuration file @include man-warning.texi @subsection Description @end ignore To get its configuration, zlibc first looks into the file described by the environment variable @code{LD_ZLIB_CONFFILE} (if any), then in @file{~/.zlibrc} and finally in @file{/usr/local/etc/zlibc.conf} (@file{/etc/zlibc.conf} on Linux @footnote{Actually the location of the system-wide include file depends on the settings of @code{sysconfdir} and @code{prefix} during @code{./configure} (@pxref{Compile-time configuration}).}). If the desired information is found in neither of these files, the compiled-in defaults are used. It is possible to supply only part of the needed information in the configuration files. In that case, the missing information is retrieved from the compiled-in defaults. This allows you to have really small runtime configuration files, which only list the differences between the desired configuration and the compiled-in configuration. If an error occurs while parsing one of the configuration files, the offending file is skipped, and the search continues with the next file. However, no error message is printed unless the environmental variable @code{LD_ZLIB_VERBOSE} is turned on (i.e. set to @code{1} or to @code{on} ). If two files contain contradictory information, the information in the file which is scanned first is retained (usually @file{~/.zlibrc}). If any flags have been set or unset using environmental variables, these settings override the flags specified in the configuration files. The configuration files are read by each process. For each process, they are read at most once, at the time when zlibc is first used (attempt to access a compressed file). Afterwards they are cached in the process's virtual memory. Thus, changing zlibc configuration files doesn't generally have any effect on already running processes. @menu * Overall structure:: * Commands section:: * Class section:: @end menu @node Overall structure, Commands section, Configuration files, Configuration files @subsection Overall structure @cindex commands section @cindex class section @cindex Parsing order of configuration files. The zlibrc files consist of two sections: A @emph{commands} section (@ref{Commands line flags}) and a @emph{class definition} section (@ref{Class section}). The commands section describes how zlibc should behave depending on the executable that it was called from. Several commands are grouped together into @emph{command classe}. The class definition section describes how zlibc should behave depending on the class of the command and the datafile opened. The configuration file may contain comments in both sections: a comment starts with a hash (@code{#}) and stops at the end of the line. Dashes (@code{-}) and underbars (@code{_}) may be used indifferently in all keywords. @node Commands section, Class section, Overall structure, Configuration files @subsection Commands section @menu * Commands section syntax:: What goes into the commands section * Commands line flags:: Which flags are available @end menu @node Commands section syntax, Commands line flags, Commands section, Commands section @subsubsection General syntax of the commands section @cindex commands section The format for a line in the "commands" section is as follows: @display @code{commands "}@var{cmd1}@code{"} [ @dots{} @code{"}@var{cmdn}@code{"} ] @code{use} @var{flags} @code{"}@var{class}@code{"} @end display In this line, the @var{cmd1} @dots{} @var{cmdn} are the basenames of the programs (commands) for which this line should apply. The basename is the name without the path, i.e. @code{ls} instead of @code{/usr/bin/ls}. The command names should be enclosed in quotes. You may also use the keyword @code{default} (without quotes) to match all commands. The @var{flags} describe those aspects of zlibc's behaviour that are independant from the datafile which is being accessed. These flags come in pairs. The flags need not to be listed on a single @code{commands} line, they may occur in several places, even in several different configuration files (for instance one in @code{/etc/zlibc.conf} and another one in @code{~/.zlibrc}. If two contradictory flags are found in the configuration files, the one which is seen first is taken. If on the other hand a certain flag is not found at all in the configuration files, the compiled-in default for this flag is used. This is usually the second flag of each pair, described below (@pxref{Commands line flags}). These flags can all be overridden by environmental variables. When the corresponding environmental variable is set to @code{1} or to @code{on}, the first flag is used, when it is set to @code{0} or to @code{off}. If the environmental variables is set to neither of these 4 values, it is ignored). The @var{class} names the commands class that these commands belong to. If, for a given command, two @code{commands} lines give different classes, the one which is seen first is taken. No union of classes is made, the classes are always treated as a whole. Thus, if you want to make a change to a command class, you need to describe it in its entirety. The following example says that the @code{tar}, @code{cpio}, @code{pax}, @code{cp} and @code{mv} show compressed files in a directory listing (@code{readdir_compr} flag), and are of class @code{generic_safe}. @example commands "tar" "cpio" "pax" "cp" "mv" use readdir_compr "generic_safe" @end example The class @code{generic_safe} would then need to be described further in the class section. @node Commands line flags, , Commands section syntax, Commands section @subsubsection Available commands line flags @vindex disable @vindex enable @vindex readdir_compr @vindex readdir_uncompr @vindex verbose @vindex silent @cindex disabling zlibc (conf. file) @cindex showing compressed files on a directory listing (conf. file) @cindex debugging zlibc This section describes the flags which can be used on a @code{commands} line. All these flags come in pairs. The table below describes each of these pairs. The first word in the header of each item is the non-default flag, the second word is the default flag, and the third word is the environmental variable by which you can override the settings from the configuration files. If this environmental variable is turned on (set to 1), the non-default (first) flag is taken, if it is turned off (set to 0), the default (second) flag is taken. @table @code @item disable / enable / LD_ZLIB_DISAB The @code{disable} flag disables zlibc for the programs on this commands line. This is useful for compression and uncompression utilities. Without this flag, @code{gunzip} would not work anymore, because it would think that the uncompressed file exists already, and it would refuse to overwrite this file. @item disable_child / enable_child / LD_ZLIB_DISAB_CHILD The @code{disable_child} flag disables zlibc for the programs started by programs on this commands line. This is implemented by removeing all occurrences of @code{uncompress.so} from the LD_PRELOAD environment variable. This function is useful for programs such as xemacs, in order to make sure that all launched subprograms return results consistent with emacs itself (directory listings, etc) @item readdir_compr / readdir_uncompr / LD_ZLIB_READDIR The readdir function shows the uncompressed files (i.e. with their trailing @code{.gz} extension) when the @code{readdir_compr} flag is set, and the compressed files otherwise. @item verbose / silent / LD_ZLIB_VERBOSE When @code{verbose} is set, zlibc prints informational messages. @item unlink / no_unlink / LD_ZLIB_UNLINK If the @code{unlink} flag is set, and if the user program tries to unlink a virtual (uncompressed) file, the package translates this call into unlinking the real file. If the @code{no_unlink} flag is set, requests to unlink virtual (uncompressed) files are silently ignored. @end table @node Class section, , Commands section, Configuration files @subsection Class section A command class@footnote{These command classes are unrelated to the classes in object oriented programming.} definition describes those aspects of zlibc's behavior that depend on the name of the datafile which is being accessed. Command classes are identified by a name which is matched against the @var{class} parameter from the commands. The class name should be enclosed between quotes both in the commands line and in the class definition. The class section contains descriptions of different command classes (i.e descriptions how datafiles should be uncompressed). Each class definition begins with a line of the following format: @display @code{class "}@var{id}@code{"} @end display The class @var{id} is the same string as the one used in the commands line. The remaining lines of a class definition are as follows: @display [ [ @var{criterion} ] [ @code{"}@var{name}@code{"} ]] @var{mode} @end display The following example shows the definition of the class used for X-servers. @example # X uses tmp files in its own directories. class "X" subdir "/usr/X11R6" usetmpfile subdir "/usr/X386" usetmpfile subdir "/usr/lib/X11" usetmpfile showpipe @end example This says that all compressed files who are in a subdirectory below @file{/usr/X11R6}, @file{/usr/X386} or @file{/usr/lib/X11} are decompressed using temporary files (@code{usetmpfile}), and that files from other directories are decompressed using pipes (@code{showpipe}) The following examples illustrates a command class, named @code{nopipe}, which always uses temporary files for decompression @display # generic class which uses temp files for all files. class "nopipe" usetmpfile @end display @menu * Criteria:: To which data files does this line apply * Mode:: How zlibc behaves for the files matching the criterion @end menu @node Criteria, Mode, Class section, Class section @subsubsection File selection Criteria @cindex directory (selection criterion) @cindex filename (selection criterion) @cindex extension (selection criterion) @cindex suffix (selection criterion) @cindex basename (selection criterion) @cindex doublespaced DOS filesystem The @var{criterion } describes what parts of the filename should match: @table @code @item filename The entire filename of the target data file must match @var{name}. @item basename The basename (filename without directory) of the target data file must match @var{name}. @item directory The data file must live in the directory @var{name}. If the user program opens the file with an absolute pathname, that filename is used as is. If on the other hand the user program uses a relative pathname, zlibc uses the most direct path to the file (i.e. without symlinks). @item subdirectory The data file must live in the directory @var{name} or in one of its subdirectories. If the user program opens the file with an absolute pathname, that filename is used as is. If on the other hand the user program uses a relative pathname, zlibc uses the most direct path to the file (i.e. without symlinks). @item suffix The data file's name must end in @var{name}. This is useful for selecting files according to their extension. @item filesystem The data file must live on the same filesystem as @var{name}. This criterion can for example be used for example to disable zlibc on a doublespaced filesystem (where zlibc would be redundant), or to switch off uncompressed size reporting on an @code{ftpfs} filesystems @footnote{uncompressed size reporting (@pxref{Size} would make @code{ls} painfully slow on an @code{ftpfs} filesystem, as all files would have to be downloaded before their size could be reported.}. @item default All data files match. All class definitions must have a default line, and this default line must be the last line of the definition. The default criterion needs no 'name' parameter. @item all All data files match. Unlike @code{default}, this line needs not to be the last line of the class definitions. Thus it is possible to specify several @code{all} lines for different aspects of @code{zlibc} behaviour. @end table The lines of each class definition are scanned in sequence, and, for each aspect@footnote{See @pxref{Mode}}, the first matching line is adopted. The class may be defined in another initialisation file, if this file is scanned later. The @var{criterion} parameter may be omitted if it can be deduced from the @var{name}. In that case, the following heuristics are used: @itemize @bullet @item @var{Name}s beginning with a dot are considered as @code{suffix}. @item @var{Name}s beginning with a slash, but not ending with a slash are considered as @var{filename}. @item @var{Name}s beginning and ending with a slash are considered as @code{subdirectory}. @item A missing @var{name} is considered as @code{default}. @item All the other @var{name}s are considered as @code{basename}. @end itemize @c With the exception of the @code{filesystem} criterion, these selection @c criteria are applied on the filename @emph{as it was provided by the @c user program}. Names might not match if they are accessed by a @c different path than the one specified in the config file. This is @c especially true for criteria using the directory part of a @c filename. Whenever possible, use the @code{suffix}, @code{basename} or @code{filesystem} criteria, because these tend to be more predictable. @node Mode, , Criteria, Class section @subsubsection Mode The @var{mode} describes the behavior of zlibc in certain situations. These are: @enumerate @item What to do when a file is accessed in readonly mode. @item What to do when a user program tries to append data to an existing file. @item What to do when a user program tries to create a new file. @item What to do when a user program tries to access an existing file and none of the preceding situations apply (@pxref{Write}). @item Whether to show the size of the uncompressed file or the size of the compressed file as a response to stat (@pxref{Size}). @end enumerate The mode for each off these 5 situations has to be described separately. For each of these 5 situations, the scan through the class description is done until the reaction of zlibc for this situation is defined. @menu * Readonly:: Behavior for programs wanting to only read files * Append:: - for programs wanting to add more data to existing files * Creation:: - for programs wanting to create new files * Write:: - for programs wanting to apply other modifications to files * Size:: - for programs wanting to know the size of a file @end menu @node Readonly, Append, Mode, Mode @unnumberedsubsubsec Reaction to a readonly request The reaction to a @code{readonly} request may be one of the following: @table @code @item show-pipe The uncompressed data file is sent to the user program using a pipe. This consumes very few resources, and it allows the decompression to run in paralell with the user process, but it has the disadvantage that the user program cannot use lseek. To warn the user program of this, the data file is shown as a named pipe (FIFO) when it is stat'ed. @item use-tmp-file This is the default setting. The data is uncompressed and put into a temporary file. The user programs then reads its data from the temporary file. This has the advantage that the user program may lseek, and the disadvantage that more disk space is consumed, while the programming is accessing the file. @item hide-pipe The data is sent through a pipe, but the file is shown as a regular file ("hidden") to the user program when it stats it. This might be needed for programs which are picky about a file type, but who actually don't need lseek. @item leave-compressed The virtual (uncompressed) file is shown as non-existent to stat, and readdir shows the physical (compressed) file. For certain programs, this is enough to disable zlibc on a file per file basis. This is useful, for example, to make emacs use its own compression support (crypt.el) instead of zlibc. Crypt.el is able to compress files when writing them back, whereas zlibc isn't able to do so. The @code{leave-compressed} doesn't work correctly with the @code{directory} and @code{subdirectory} criteria. Use the @code{filesystem} criterion instead. @item dir-leave-compressed The virtual (uncompressed) file is shown to stat, but readdir shows the physical (compressed) file. This is useful to tell zlibc that we prefer working on the physical file, but without making access to the virtual file impossible. The @code{dir-leave-compressed} doesn't work with the @code{dir} and @code{subdir} criteria. Use the @code{filesystem} criterion instead. @end table @node Append, Creation, Readonly, Mode @unnumberedsubsubsec Reaction to an append request The reaction to an @code{append} request may be one of the following: @table @code @item append-compressed When a user program tries to append data to a non-existant file, but the corresponding compressed file exists, zlibc translates this request into appending the compressed data to the compressed file. @strong{WARNING-1:} This works with gzip, and might not work with other (un)compressors! This relies on gzip's feature to consider a concatenation of compressed files as a compression of concatenated files. @strong{WARNING-2:} This is only reliable if you can guarantee that the file is not accessed by some other program while the first one has it still open, or that it won't be opened again (even by the same program) shortly after it has been closed. Delays longer than a second should be ok. Don't enable @code{append-compressed} if you expect the file to be written to by several programs at once. @item no-append-compressed Don't append to a compressed file (the user program will get a file not found error). This is the default behavior. @end table @node Creation, Write, Append, Mode @unnumberedsubsubsec Reaction to a file creation request The reaction to a @code{create} request may be one of the following: @table @code @item create-compressed When a user program tries to create a new file whose name matches the pattern, zlibc translates this request into creating a compressed file. A file is considered to be created, if the @code{O_TRUNC} flag is set, or if both @code{O_CREAT} and @code{O_EXCL} are set. This only applies to files opened write-only. @strong{WARNING-1:} This is only reliable if you can guarantee that the newly created file is not accessed by some other program while the first one has it still open, or that it won't be opened again (even by the same program) shortly after it has been closed. @strong{WARNING-2:} This should not be used if you expect the program to seek in this file. @item no-create-compressed Newly created files are created uncompressed. This is the default. @end table @node Write, Size, Creation, Mode @unnumberedsubsubsec Other write requests The reaction to other @code{write} requests may be one of the following: @table @code @item uncompress-before-write When a user program tries to write to a non-existing file, and when a compressed file with a corresponding name exists, this file is uncompressed in place (i.e. having the same name, but without the .gz extension) @strong{WARNING-1:} This is only safe when you can guarantee that the file is not opened by several programs at once. However, once the call to the open function has returned, other programs may open this file safely. If a second program tries to open the file during the open call of the first, this second program gets a permission error. @strong{WARNING-2:} When using this option, be careful when opening files belonging to another user, or files living in a directory where you have no write access to. Using this option in a directory without write access will result in a permission error. Using this option in a directory where you do have write access will change the ownership of the file to you, even if it belonged to another user initially. @item no-uncompress-before-write Compressed files are not uncompressed before writing to them, and zlibc returns a "file not found" error. This is the default. @end table If several of these options apply for the same file, @code{create-compressed} has priority over @code{append-compressed} which has priority over @code{uncompress-before-write}. @node Size, , Write, Mode @unnumberedsubsubsec Size shown for compressed files @cindex find @cindex size of compressed files @cindex slowness (of find due to reading the size) @vindex show-compressed-size @cindex ftpfs @cindex ls slowness (on an ftpfs filesystem) @cindex slowness (of ls, on an ftpfs filesystem) @cindex hanging (of ls, on an ftpfs filesystem) When an application calls @code{stat} to fetch the attributes of a file (such as its permissions, size, type, etc.), zlibc stats the corresponding compressed file instead. After doing so, zlibc has to adjust some of the values returned by stat, such as the type and the size. The type has to be adjusted for those files that should be shown as pipes. The size has to be adjusted because user programs are usually interested in the amount of data that they can actually read from the file (i.e. the size of the uncompressed file) rather than the size of the physical file (i.e. the size of the compressed file). However, in order to find out the size of the uncompressed file, zlibc has to read some data of the file, which may impact performance in situations where many files are stat'ed. This is for instance the case for @code{find}, or for @code{ls} on an @code{ftpfs} filesystem. The following two behaviors of the stat call may be specified: @table @code @item show-compressed-size Stat returns the size of the compressed file. This is less useful for the application, but more efficient. If you mount any @code{ftpfs} filesystems, you may switch on @code{show-compressed-size} just for that filesystem by using the @code{filesystem} criterion (@pxref{Criteria}). @item show-uncompressed-size Stat returns the size of the uncompressed file. This is more useful for the application, but less efficient. This is the default behavior. @end table @ignore @subsection See also zlibc(3) @end ignore @c zlibc.3end-skip @c zlibc-conf.5skip @node Compiled-in defaults, Compile-time configuration, Configuration files, Customization @section Compiled-in defaults It is possible to operate zlibc entirely without configuration files. In this case, it uses the @emph{compiled-in defaults}. These are generated at compile-time from the @file{zlibrc.sample} file. This file has the same syntax as the configuration files described above (@pxref{Configuration files}). If you want to change the compiled-in defaults of zlibc, edit that file, and remake. @node Compile-time configuration, , Compiled-in defaults, Customization @section Compile-time configuration via GNU autoconf @cindex configure options @cindex temporary file directory @cindex directory for temporary files @cindex compile-time configuration Before it can be compiled, zlibc must be configured using the GNU autoconf script @code{./configure}. In most circumstances, running @code{./configure} without any parameters is enough. However, you may customize zlibc using various options to @code{./configure}. The following options are supported: @table @code @item --prefix @var{directory} Prefix used for any directories used by zlibc. By default, this is @file{/usr/local}. Zlibc is installed in @file{$prefix/lib}, looks for its system wide configuration file in @file{$prefix/etc}. Man pages are installed in @file{$prefix/man}, info pages in @file{$prefix/info} etc. On Linux, if you use zlibc via @file{/etc/ld.so.preload}, you should use @file{/} as the prefix instead of the default @file{$prefix/lib}. @item --sysconfdir @var{directory} Directory containing the system-wide configuration file @file{zlibc.conf}. By default, this is derived from @code{prefix} (see above). @item --disable-runtime-conf Disables run time configuration via environmental variables and via the configuration files. This may be needed in hyper secure environments. @item --disable-env-conf Disables run time configuration via environmental variables @item --disable-have-proc Tells zlibc not to use the /proc filesystem to find out the commandline of the programs for which it runs, even if a working /proc is detected. @item --disable-have-proc Tells zlibc to use the /proc filesystem to find out the commandline of the programs for which it runs, even if no working /proc is detected. @item --with-compr-ext=@var{extension} Uses @var{extension} as the filename extension of compressed files. By default, is @code{.gz} @item --with-extlen=@var{length} Allows to configure compressed filename extensions with at most @var{length} character via runtime configuration. By default is 5. @item --with-tmpdir=@var{directory} Uses @var{directory} to store the uncompressed files. By default is @code{/tmp}. @item --with-uncompressor=@var{uncompressor-command-line} Defines how the program for uncompressing files should be invoked. This command should read the compressed file from stdin, and output the uncompressed data to stdout By default is @code{gzip -dc}. @end table In addition to the above-listed options, the standard GNU autoconf options apply. Type @code{./configure --help} to get a complete list of these. @ignore @subsection See also zlibc.conf(5) @end ignore @c zlibc-conf.5end-skip @c MANskip @node Porting zlibc, Variable Index, Customization, Top @chapter Porting zlibc Zlibc has been tested on three variants of Unix so far: Linux, SunOs, Solaris. On all three platforms, zlibc has been compiled using GNU make and gcc. However, porting it to other platforms should be straightforward as long as they verify both of the following conditions: @enumerate @item The target platform should have shared library support. The default Makefile links zlibc by supplying the flags @code{-nostdlib -shared} to gcc in addition to the usual @code{CFLAGS}. If your target platform needs different flags to make shared libraries, change the definition of the variable @code{SHAREDCFLAGS} in the Makefile. @item The target platform should supply a way to perform system calls directly without going through the library functions. Indeed, this is needed because we are redefining the library functions and thus the default functions become unavailable. Usually direct syscalls done by calling the syscall function. For instance, in order to perform @code{open("test", O_RDONLY)} directly, @code{sycall(SYS_open, "test", O_RDONLY)} is called. If your target platform uses a different way to perform direct system calls, you need to supply different definitions for the real_xxx functions in direct_sys.h. This is the case for AIX. @item The target platform should provide a way to instruct the dynamic linker to preload programs with extra object files not present in the shared library. Any symbols defined in that object file override equivalent symbols from libc. Usually this is done by pointing the @code{LD_PRELOAD} variable to the object file to be used. Unfortunately, I have found no way to achieve this on AIX. Any ideas about how to do this are welcome. @end enumerate Many platforms, including Solaris, provide several aliases for their syscall stubs. It would be interesting to leave one of them alone, and use it as a "direct syscall" stub, but unfortunately, it turns out that in sometimes both stubs are used by the library! Thus, what would be an advantage, becomes actually a disadvantage, because we will need to override these aliases in addition to the canonical names. This is done in altnames.c. Change it as needed. In order to know the names of these aliases, try the following command: @code{nm /lib/libc.so | grep lstat}. This lists any library symbols with @code{unlink} in their name, which could be aliases. If you have successfully ported zlibc to a new platform, could you drop me a note, so that I can include support for that platform in my next release. Thanks @node Variable Index, Concept Index, Porting zlibc, Top @unnumbered Variable index @printindex vr @node Concept Index, , Variable Index, Top @unnumbered Concept index @printindex cp @contents @c MANend-skip @bye zlibc-0.9k/lsetxattr.c0000444000076400001440000000151707663767072015475 0ustar aknaffusers00000000000000/* * lsetxattr.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef HAVE_SETXATTR int lsetxattr(__const char *file_name, const char *name, const void *value, size_t size, int flags) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_lsetxattr(file_name, name, value, size, flags); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Setxattr %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_lsetxattr(newname, name, value, size, flags); } #endif zlibc-0.9k/lremovexattr.c0000444000076400001440000000137507620302027016153 0ustar aknaffusers00000000000000/* * lgetxattr.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef HAVE_GETXATTR int lremovexattr(__const char *file_name, const char *name) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_lremovexattr(file_name, name); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Getxattr %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_lremovexattr(newname, name); } #endif zlibc-0.9k/config.make.sun0000444000076400001440000000013207306412072016154 0ustar aknaffusers00000000000000BINFMT=none CC=gcc OBJEXT=o CFLAGS1=-fpic LDFLAGS1= TARGET=uncompress.o STUB=na SLDFLAGS= zlibc-0.9k/COPYING0000444000076400001440000000023507306412072014303 0ustar aknaffusers00000000000000Copyright (C) 1993 Alain Knaff. You may use, distribute and copy this program according to the terms of the GNU General Public License version 2 or later. zlibc-0.9k/strsep.c0000444000076400001440000000067710205745725014754 0ustar aknaffusers00000000000000/* * strsep.c * * Copyright (C) 1993 Alain Knaff */ #include #include #include #ifndef HAVE_STRSEP /* * SunOs lacks strsep */ char *strsep(char **stringp,__const char *delim) { char *newpos, *oldpos; oldpos = *stringp; if ( oldpos == NULL ) return NULL; newpos = strpbrk( oldpos, delim); if ( newpos ){ *newpos='\0'; newpos++; } *stringp = newpos; return oldpos; } #endif zlibc-0.9k/compile_config.c0000444000076400001440000000006107306412072016366 0ustar aknaffusers00000000000000#define CONFIG_COMPILER #include "parseconfig.c" zlibc-0.9k/readdir.c0000444000076400001440000000201310210165121015006 0ustar aknaffusers00000000000000#ifdef linux #define DIRENT_ILLEGAL_ACCESS /* for dirent */ #endif #define _LARGEFILE64_SOURCE #define _GNU_SOURCE /* * readdir.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" struct dirent *__libc_readdir(DIR * dir); #define READDIR readdir #define real_READDIR zlib_real_readdir #define DIRENT dirent #define ADJUST_NAME adjust_name #define GETDENTS getdents #define real_GETDENTS zlib_real_getdents #include "readdir_tmpl.c" #undef READDIR #undef real_READDIR #undef DIRENT #undef ADJUST_NAME #undef GETDENTS #undef USE_GETDENTS #undef real_GETDENTS #if (defined HAVE_READDIR64 || defined HAVE_GETDENTS64) extern struct dirent64 *__readdir64 (DIR *dirp); #define READDIR readdir64 #define real_READDIR zlib_real_readdir64 #define DIRENT dirent64 #define ADJUST_NAME adjust_name64 #if (defined HAVE_GETDENTS64 || defined SYS_getdents64) #define GETDENTS getdents64 #define real_GETDENTS zlib_real_getdents64 #endif #include "readdir_tmpl.c" #endif zlibc-0.9k/chmod.c0000444000076400001440000000130607620267751014521 0ustar aknaffusers00000000000000/* * chmod.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" int chmod(__const char *file_name, mode_t mode) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st = zlib_real_chmod(file_name, mode); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Chowning %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_chmod(newname, mode); } zlibc-0.9k/getxattr.c0000644000076400001440000000145407663767143015306 0ustar aknaffusers00000000000000/* * getxattr.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef HAVE_GETXATTR ssize_t getxattr(__const char *file_name, const char *name, void *value, size_t size) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_getxattr(file_name, name, value, size); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Getxattr %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_getxattr(newname, name, value, size); } #endif zlibc-0.9k/chown.c0000444000076400001440000000136307620267751014550 0ustar aknaffusers00000000000000/* * chown.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #include "zlibc.h" int chown(__const char *file_name, uid_t owner, gid_t group) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st = zlib_real_chown(file_name, owner, group); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Chowning %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_chown(newname, owner, group); } zlibc-0.9k/altnames.c0000444000076400001440000000234010206044507015214 0ustar aknaffusers00000000000000#ifndef aix #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" ALIASF1(access, _access, int); ALIASF1(chmod, _chmod, mode_t); ALIASF1(stat, _stat, struct stat*); ALIASF1(lstat, _lstat, struct stat*); #ifdef SYS_UTIME ALIASF1(utime, _utime, struct utimbuf *); #endif #ifdef SYS_UTIMES int utimes(); ALIASF1(utimes, _utimes, struct timeval *); #endif ALIAS2F(link, _link); ALIAS2F(symlink, _symlink); ALIAS2F(rename, _rename); ALIASF2(chown, _chown, uid_t, gid_t); ALIAS3(getdents, _getdents, int, unsigned int, struct dirent *, unsigned int); ALIAS3(getdents, __getdents, int, unsigned int, struct dirent *, unsigned int); #ifdef SYS_getdents64 int getdents64(int fd, struct dirent64 *dirp, unsigned int count); ALIAS3(getdents64, _getdents64, int, unsigned int, struct dirent64 *, unsigned int); ALIAS3(getdents64, __getdents64, int, unsigned int, struct dirent64 *, unsigned int); #endif ALIASF2(open, _open, int, mode_t); ALIASF2(open64, _open64, int, mode_t); ALIASF2(open, __open, int, mode_t); ALIASF2(open64, __open64, int, mode_t); ALIASF0(unlink, _unlink); ALIAS1(readdir, _readdir, struct dirent *, DIR *); ALIASF2(readlink, _readlink, char *, size_t); ALIASF2(readlink, __readlink, char *, size_t); #endif zlibc-0.9k/removexattr.c0000444000076400001440000000137407663765255016025 0ustar aknaffusers00000000000000/* * removexattr.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef HAVE_GETXATTR int removexattr(__const char *file_name, const char *name) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_removexattr(file_name, name); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Getxattr %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; return zlib_real_removexattr(newname, name); } #endif zlibc-0.9k/man-warning.texi0000444000076400001440000000207507306412072016365 0ustar aknaffusers00000000000000@ignore @c for man page version only @unnumbered Warning This manpage has been automatically generated from zlibc's texinfo documentation. However, this process is only approximative, and some items, such as crossreferences, footnotes and indices are lost in this translation process. Indeed, this items have no appropriate representation in the manpage format. Thus I strongly advise you to use the original texinfo doc. @itemize @bullet @item To generate a printable copy from the texinfo doc, run the following commands: @example ./configure; make dvi; dvips zlibc.dvi @end example @item To generate a html copy, run: @example ./configure; make html @end example A premade html can be found at: @file{http://www.tux.org/pub/knaff/zlibc/zlibc.html} @item To generate an info copy (browsable using emacs' info mode), run: @example ./configure; make info @end example @end itemize The texinfo doc looks most pretty when printed or as html. Indeed, in the info version certain examples are difficult to read due to the quoting conventions used in info. @end ignore zlibc-0.9k/utimes.c0000444000076400001440000000144707620267752014744 0ustar aknaffusers00000000000000/* * utimes.c * * Copyright (C) 1993 Alain Knaff */ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE #include "sysincludes.h" #ifdef SYS_UTIMES int utimes(__const char *file_name, struct timeval *buf) { int st; char newname[MAXPATHLEN + MAXEXTLEN + 1]; _zlibc_init(); st=zlib_real_utimes(file_name, buf); if ( st >= 0 || errno != ENOENT ) return st; zlib_initialise(); if ( zlib_mode & CM_DISAB ) return st; if ( (zlib_getfiletype(file_name,-1) & PM_READ_MASK) == PM_LEAVE_COMPR) return st; if ( zlib_mode & CM_VERBOSE ) fprintf(stderr,"Utiming %s\n",file_name); strncpy(newname,file_name,1024); strcat(newname,zlib_ext); errno = 0; st=zlib_real_utimes(newname, buf); if ( st < 0 && errno == EINVAL ) errno = ENOENT; return st; } #endif