⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iffe.1

📁 su 的源代码库
💻 1
字号:
.\" format with nroff|troff|groff -man.nr mI 0.de H1.if \\n(mI!=0 \{.nr mI 0.RE.\}.TP\fB\\$1\fP...de H3.if \\n(mI=0 \{.nr mI 1.RS.\}.TP\fB     \\$1\fP...de OP.if \\n(mI!=0 \{.nr mI 0.RE.\}.ie !'\\$1'-' \{.ds mO \\fB\\-\\$1\\fP.ds mS ,\\0.\}.el \{.ds mO \\&.ds mS \\&.\}.ie '\\$2'-' \{.if !'\\$4'-' .as mO \\0\\fI\\$4\\fP.\}.el \{.as mO \\*(mS\\fB\\-\\-\\$2\\fP.if !'\\$4'-' .as mO =\\fI\\$4\\fP.\}.TP\\*(mO...de FN.if \\n(mI!=0 \{.nr mI 0.RE.\}.TP\\$1 \\$2...TH iffe 1.SH NAMEiffe - host C compilation environment feature probe.SH SYNOPSIS\fBiffe\fP\ [\ \fIoptions\fP\ ]\ [\ -\ ]\[\ file.iffe\ |\ statement\ [\ :\ statement\ ...\ ]\ ].SH DESCRIPTION\fBiffe\fP is a command interpreter that probes the host C compilation environment forfeatures. A feature is any file, option or symbol that controls or is controlled by the Ccompiler. \fBiffe\fP tests features by generating and compiling C programs and observingthe behavior of the C compiler and generated programs..PP\fBiffe\fP statements are line oriented. Statements may appear in the operand list withthe \fB:\fP operand or \fBnewline\fP as the line delimiter. The standard input is read ifthere are no command line statements or if \fIfile\fP\fB.iffe\fP is omitted..PPThough similar in concept to \fBautoconfig\fP(1) and \fBconfig\fP(1), there arefundamental differences. The latter tend to generate global headers accessed by allcomponents in a package, whereas \fBiffe\fP is aimed at localized, self contained featuretesting..PPOutput is generated in \fBFEATURE/\fP\fItest\fP by default, where \fItest\fP is the basename of \fIfile\fP\fB.iffe\fP or the \fBiffe\fP \fBrun\fP command file operand. Output isfirst generated in a temporary file; the output file is updated if it does not exist orif the temporary file is different. If the first operand is \fB-\fP then the output iswritten to the standard output and no update checks are done..PPFiles with suffixes \fB.iffe\fP and \fB.iff\fP are assumed to contain \fBiffe\fPstatements..SH OPTIONS.OP a all flag -Define failed test macros \fB0\fP. By default only successful test macros are defined\fB1\fP..OP c cc string C-compiler-name\ [C-compiler-flags\ ...]Sets the C compiler name and flags to be used in the feature tests..OP C config flag -Generate \fBconfig\fP(1) style \fIHAVE_\fP* macro names. This implies \fB--undef\fP.Since \fBconfig\fP(1) has inconsistent naming conventions, the \fBexp\fP command may beneeded to translate from the (consistent) \fBiffe\fP names. Unless otherwise noted a\fBconfig\fP macro name is the \fBiffe\fP macro name prefixed with \fBHAVE\fP andconverted to upper case. \fB--config\fP is set by default if the command argumentscontain a \fBrun\fP command on an input file with the base name \fBconfig\fP..OP d debug number levelSets the debug level. Level 0 inhibits most error messages, level 1 shows compilermessages, and level 2 traces internal \fBiffe\fP \fBsh\fP(1) actions..OP i input string fileSets the input file name to \fIfile\fP, which must contain \fBiffe\fP statements..OP o output string fileSets the output file name to \fIfile\fP..OP e package string nameSets the \fBproto\fP(1) package name to \fIname\fP..OP p prototyped flag -Emits \fB#pragma prototyped\fP at the top of the output file. See \fBproto\fP(1)..OP P pragma string textEmits \fB#pragma\fP \fItext\fP at the top of the output file..OP s shell string shell-pathSets the internal shell name to \fIshell-path\fP. Used for debugging Bourne shellcompatibility (otherwise \fBiffe\fP uses \fIksh\fP constructs if available)..OP S static string flagsSets the C compiler flags that force static linking. If not set then \fBiffe\fP probesthe compiler to determine the flags. \fBiffe\fP must use static linking (no dlls) becauseon some systems missing library symbols are only detected when referenced at runtime fromdynamically linked executables..OP u undef flag -\fB#undef\fP failed test macros. By default only successful test macros are defined\fB1\fP..OP v verbose flag -Produce a message line on the standard error for each test as it is performed..SH SYNTAX\fBiffe\fP input consists of a sequence of statement lines. Statements that span morethan one line contain \fIbegin\fP\fB{\fP as the last operand (where \fIbegin\fP iscommand specific) and zero or more data lines terminated by a line containing \fB}end\fPas the first operand. The statements syntax is: \fIop\fP[,\fIop\fP...][\fIarg\fP[,\fIarg\fP...]] [\fIprereq\fP ...] [\fIbegin\fP{ ... |\fBend\fP ...][= [\fIdefault\fP]]. \fIop\fPs and \fIarg\fPs may be combined, separated by commas, toperform a set of operations on a set of arguments..PP\fIprereq\fPs are used when applying the features tests and may be combinations of:.H1 compiler\ options\fB-D\fP*, \fB-L\fP*, etc..H1 library\ references\fB-l\fP*, *\fB.a\fP, etc. \fB_LIB_\fP\fIname\fP is defined to be 1 if \fB-l\fP\fIname\fPis a library..H1 header\ references*\fB.h\fP. \fI_dir_name\fP is defined to be 1 if \fIdir/name\fP\fB.h\fP is a header, orif \fIdir\fP is omitted, \fB_hdr_\fP\fIname\fP is defined to be 1 if \fIname\fP\fB.h\fPis a header..H1 -Prereq grouping mark; prereqs before the first \fB-\fP are passed to all feature tests.Subsequent groups are attempted in left-to-right order until the first successful groupis found..PP\fIbegin\fP\fB{\fP ... \fB}end\fP delimit multiline code blocks that override or augmentthe default code provided by \fBiffe\fP. User supplied code blocks should be compatiblewith the K&R, ANSI, and C++ C language dialects for maximal portability. In addition toall macro definitions generated by previous tests, all generated code contains thefollowing at the top to hide dialect differences:.H1 #if\ defined(__STDC__)\ ||\ defined(__cplusplus)\ ||\ defined(c_plusplus).H1 #define\ _STD_\ 1.H1 #define\ _ARG_(x)\ x.H1 #define\ _VOID_\ void.H1 #else.H1 #define\ _STD_\ 0.H1 #define\ _ARG_(x)\ ().H1 #define\ _VOID_\ char.H1 #endif.H1 #if\ defined(__cplusplus).H1 #define\ _BEGIN_EXTERNS_\ extern\ "C"\ {.H1 #define\ _END_EXTERNS_\ }.H1 #else.H1 #define\ _BEGIN_EXTERNS_.H1 #define\ _END_EXTERNS_.H1 #endif.H1 #define\ _NIL_(x)\ ((x)0).PP= \fIdefault\fP may be specified for the \fBkey\fP, \fBlib\fP, \fBmth\fP and \fBtyp\fPcommands. If the test fails for \fIarg\fP then \fB#define\fP \fIarg\fP \fIdefault\fP isemitted. \fBkey\fP accepts multiple \fB= \fP\fIdefault\fP values; the first valid one isused..PPEach test statement generates a portion of a C language header that contains macrodefintions, comments, and other text corresponding to the feature test commands.\fB#ifndef _def_\fP\fIname\fP\fB_\fP\fIdirectory\fP ... \fB#endif\fP guards the generatedheader from multiple \fB#include\fPs, where \fIname\fP is determined by either the\fBrun\fP command input file name if any, or the first \fIop\fP of the first command, and\fIdirectory\fP is the basname component of either the \fBrun\fP command file, if any, orthe current working directory. The output file name is determined in this order:.H1 -If the first command line operand is \fB-\fP then the output is written to the standardoutput..H1 --output=fileOutput is \fIfile\fP..H1 set\ out\ fileOutput is \fIfile\fP..H1 [run]\ [directory/]base[.suffix]Output is \fBFEATURE/\fP\fIbase\fP..PPGenerated \fBiffe\fP headers are often referenced in C source as: \fB#include"FEATURE/\fP\fIfile\fP". The \fBnmake\fP(1) base rules contain metarules for generating\fBFEATURE/\fP\fIfile\fP from \fBfeatures/\fP\fIfile\fP[\fIsuffix\fP], where \fIsuffix\fPmay be omitted, \fB.c\fP, or \fB.sh\fP (see the \fBrun\fP command below). Because\fB#include\fP prerequisites are automatically detected, \fBnmake\fP(1) ensures that allprerequisite \fBiffe\fP headers are generated before compilation. Note that thedirectories are deliberately named \fBFEATURE\fP and \fBfeatures\fP to keepcase-insensitive file systems happy..PPThe feature test commands are:.H1 #\ commentComment line - ignored..H1 cmd\ nameDefines \fB_cmd_\fP\fIname\fP if \fIname\fP is an executable in one of the standardsystem directories (\fB/bin, /etc, /usr/bin, /usr/etc, /usr/ucb\fP).\fB_\fP\fIdirectory\fP\fB_\fP\fIname\fP is defined for \fIdirectory\fP in which\fIname\fP is found (with \fB/\fP translated to \fB_\fP)..H1 dat\ nameDefines \fB_dat_\fP\fIname\fP if \fIname\fP is a data symbol in the default libraries..H1 def\ nameEquivalent to \fBcmd,dat,hdr,key,lib,mth,sys,typ\fP \fIname\fP..H1 exp\ name\ expressionIf \fIexpression\fP is a "..." string then \fIname\fP is defined to be the string, elseif the \fBexpr\fP(1) evaluation of \fIexpression\fP is not 0 then \fIname\fP is definedto be 1, otherwise \fIname\fP is defined to be 0. Identifiers in \fIexpression\fP may bepreviously defined names from other \fBiffe\fP commands; undefined names evaluate to 0..H1 hdr\ nameDefines \fB_hdr_\fP\fIname\fP if the header \fB<\fP\fIname\fP\fB.h>\fP exists. The\fB--config\fP macro name is \fBHAVE_\fP\fINAME\fP\fB_H\fP..H1 iff\ nameThe generated header \fB#ifndef-#endif\fP macro guard is \fB_\fP\fIname\fP\fB_H\fP..H1 key\ nameDefines \fB_key_\fP\fIname\fP if \fIname\fP is a reserved word (keyword)..H1 lcl\ nameGenerates a \fB#include\fP statement for the local version of either the header\fB<\fP\fIname\fP\fB.h>\fP if it exists or the header \fB<sys/\fP\fIname\fP\fB.h>\fP ifit exists. Defines \fB_lcl_\fP\fIname\fP on success. The \fB--config\fP macro name is\fBHAVE_\fP\fINAME\fP\fB_H\fP..H1 lib\ nameDefines \fB_lib_\fP\fIname\fP if \fIname\fP is an external symbol in the defaultlibraries..H1 mac\ nameDefines \fB_mac_\fP\fIname\fP if \fIname\fP is a macro..H1 mem\ struct.memberDefines \fB_mem_\fP\fImember\fP\fB_\fP\fIstruct\fP if \fImember\fP is a member of thestructure \fIstruct\fP..H1 mth\ nameDefines \fB_mth_\fP\fIname\fP if \fIname\fP is an external symbol in the math library..H1 nop\ nameIf this is the first command then \fIname\fP may be used to name the output file and/orthe output header guard macro. Otherwise this command is ignored..H1 npt\ nameDefines \fB_npt_\fP\fIname\fP if the \fIname\fP symbol requires a prototype. The\fB--config\fP macro name is \fB\fP\fINAME\fP\fB_DECLARED\fP with the opposite sense..H1 num\ nameDefines \fB_num_\fP\fIname\fP if \fIname\fP is a numeric constant \fIenum\fP or\fImacro\fP..H1 one\ header\ ...Generates a \fB#include\fP statement for the first header found in the \fIheader\fP list..H1 pth\ file\ [\ dir\ ...\ |\ {\ g1\ -\ ...\ -\ gn\ }\ |\ <\ pkg\ [ver\ ...]\ >\ ]Defines \fB_pth_\fP\fIfile\fP, with embedded \fB/\fP chars translated to \fB_\fP, to thepath of the first instance of \fIfile\fP in the \fIdir\fP directories. \fB{\fP ...\fB}\fP forms a directory list from the cross-product of \fB-\fP separated directorygroups \fIg1\fP ... \fIgn\fP. < ... > forms a directory list for the package \fIpkg\fPwith optional versions. The \fB--config\fP macro name is \fINAME\fP\fB_PATH\fP..H1 run\ fileRuns the tests in \fIfile\fP based on the \fIfile\fP suffix:.H2 .c\fIfile\fP is compiled and executed and the output is copied to the \fBiffe\fP outputfile..H2 .sh\fIfile\fP is executed as a shell script and the output is copied to the \fBiffe\fPoutput file..H2 .iffe\ or\ no\ suffix\fIfile\fP contains \fBiffe\fP statements..H1 set\ option\ valueSets option values. The options are described above..H1 siz\ nameDefines \fB_siz_\fP\fIname\fP to be \fBsizeof\fP(\fIname\fP) if \fIname\fP is a type inany of \fB<sys/types.h>, <times.h>, <stddef.h>, <stdlib.h>\fP. Any \fB.\fP characters in\fIname\fP are translated to space before testing and are translated to \fB_\fP in theoutput macro name..H1 sym\ nameDefines \fB_ary_\fP\fIname\fP if \fIname\fP is an array, \fB_fun_\fP\fIname\fP if\fIname\fP is a function pointer, \fB_ptr_\fP\fIname\fP if \fIname\fP is a pointer, or\fB_reg_\fP\fIname\fP if \fIname\fP is a scalar. In most cases \fIname\fP is part of amacro expansion..H1 sys\ nameDefines \fB_sys_\fP\fIname\fP if the header \fB<sys/\fP\fIname\fP\fB.h>\fP exists. The\fB--config\fP macro name is \fBHAVE_SYS_\fP\fINAME\fP\fB_H\fP..H1 tst\ nameA user defined test on name. A source block must be supplied. Defines \fB_\fP\fIname\fPon success..H1 typ\ nameDefines \fB_typ_\fP\fIname\fP if \fIname\fP is a type in any of \fB<sys/types.h>,<times.h>, <stddef.h>, <stdlib.h>\fP. Any \fB.\fP characters in \fIname\fP are translatedto space before testing and are translated to \fB_\fP in the output macro name..H1 val\ nameThe output of \fBecho\fP \fIname\fP is written to the output file..PPCode block names may be prefixed by \fBno\fP to invert the test sense. The block namesare:.H1 catThe block is copied to the output file..H1 compileThe block is compiled (\fBcc -c\fP)..H1 executeThe block is compiled, linked, and executed. \fB0\fP exit status means success..H1 failIf the test fails then the block text evaluated by \fBsh\fP(1)..H1 linkThe block is compiled and linked (\fBcc -o\fP)..H1 macroThe block is preprocessed (\fBcc -E\fP) and text bracketed by \fB<<\fP ... \fB>>\fP iscopied to the output file..H1 menuNot implemented..H1 noIf the test fails then the block text is copied to the output file..H1 noteIf the test succeeds then the block is copied to the output as a \fB/*\fP ... \fB*/\fPcomment..H1 outputThe block is compiled, linked, and executed, and the output is copied to the output file..H1 passIf the test succeeds then the block text evaluated by \fBsh\fP(1)..H1 preprocessThe block is preprocessed (\fBcc -E\fP)..H1 promptNot implemented..H1 runThe block is executed as a shell script and the output is copied to the output file.Succesful test macros are also defined as shell variables with value \fB1\fP and areavailable within the block. Likewise, failed test macros are defined as shell variableswith value \fB0\fP..H1 yesIf the test succeeds then the block text is copied to the output file..SH SEE\ ALSO\fBautoconfig\fP(1), \fBconfig\fP(1), \fBnmake\fP(1), \fBproto\fP(1), \fBsh\fP(1).SH IMPLEMENTATION.H1 versioniffe (AT&T Labs Research) 2000-03-17.H1 authorGlenn Fowler <gsf@research.att.com>.H1 authorPhong Vo <kpv@research.att.com>.H1 copyrightCopyright (c) 1994-2000 AT&T Corp..H1 licensehttp://www.research.att.com/sw/license/ast-open.html

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -