📄 configure
字号:
echo "$* \\c" }elif [ "`echo -n foo`@" = "foo@" ]; then prompt() { echo -n "$* " }else prompt() { echo "$*" }fi## Prompt the user for a string that can not be null.#promptForNonNullStringParameter(){ x="" val="$1" desc="$2" while [ -z "$x" ]; do prompt "$desc [$val]?"; read x if [ "$x" ]; then # strip leading and trailing white space x=`echo "$x" | sed -e 's/^[ ]*//' -e 's/[ ]*$//'` else x="$val" fi done param="$x"}promptForManPageScheme(){ x="" while [ -z "$x" ]; do prompt "Manual page installation scheme [$MANSCHEME]?"; read x if [ "$x" ]; then # strip leading and trailing white space x=`echo "$x" | sed -e 's/^[ ]*//' -e 's/[ ]*$//'` # XXX do a better job of validating... case "$x" in bsd-nroff-cat*|sysv-nroff-cat*) ;; bsd-nroff-gzip*|sysv-nroff-gzip*) ;; bsd-nroff-comp*|sysv-nroff-comp*) ;; bsd-nroff-pack*|sysv-nroff-pack*) ;; bsd-source-cat*|sysv-source-cat*) ;; bsd-source-gzip*|sysv-source-gzip*) ;; bsd-source-comp*|sysv-source-comp*) ;; bsd-source-pack*|sysv-source-pack*) ;; *)cat <<EOF"$x" is not a valid manual page installation scheme. Schemes areconstructed according to: <organization>-<formatting>-<compression>[-<suffix>]where:<organization> is either "bsd" for BSD-style section organization (e.g. file formats in section 5) or "sysv" for System V-style organization (e.g. file formats in section 4).<formatting> is either "nroff" to force installation of formatted materials (using nroff) or "source" to get the nroff source installed.<compression> is either the name of a program to compress the manual pages (gipz, compress, pack) or "cat" for uncompressed data.<suffix> is either the file suffix to convert installed pages to (e.g. 0.gz for gzip-compressed pages under BSD) or "strip" to force the normal ".4f" suffix to be converted to ".4" (or ".5" if using the BSD organization). If no -<suffix> is specified then filenames are not converted when they are installed.Common schemes are:bsd-nroff-gzip-0.gz compressed formatted pages for BSD bsd-source-cat nroff source w/ BSD organizationsysv-source-cat-strip nroff source for SysV w/o .4f suffixsysv-source-cat nroff source for SysV as-isEOF x="";; esac else x="$MANSCHEME" fi done MANSCHEME="$x"}printConfig(){ cat<<EOFTIFF configuration parameters are:[ 1] Directory for tools: $DIR_BIN[ 2] Directory for libraries: $DIR_LIB[ 3] Directory for include files: $DIR_INC[ 4] Directory for manual pages: $DIR_MAN[ 5] Directory for HTML documents: $DIR_HTML[ 6] Manual page installation scheme: $MANSCHEMEEOF}promptForParameter(){ case $1 in 1) promptForNonNullStringParameter "$DIR_BIN" \ "Directory to install tools"; DIR_BIN="$param" ;; 2) promptForNonNullStringParameter "$DIR_LIB" \ "Directory to install libraries"; DIR_LIB="$param" ;; 3) promptForNonNullStringParameter "$DIR_INC" \ "Directory to install include files"; DIR_INC="$param" ;; 4) promptForNonNullStringParameter "$DIR_MAN" \ "Directory to install manual pages"; DIR_MAN="$param" ;; 5) promptForNonNullStringParameter "$DIR_HTML" \ "Directory to install HTML documents"; DIR_HTML="$param" ;; 6) promptForManPageScheme;; esac}checkJPEG(){ if [ "${JPEG}" = yes ]; then test "`findHeader jpeglib.h`" || { cat<<EOFThe set of libtiff include directories, DIRS_LIBINC=${DIRS_LIBINC}does not seem to be setup correctly; "jpeglib.h" was not found.This must be corrected if the JPEG support is to be enabled.Either fix the pathname or disable the JPEG support.EOF } test $SRCDIR_IS_LIBTIFF = yes || \ test -d "${DIR_JPEGLIB:-/dev/null/no-such-file}" || { cat<<EOFThe JPEG library directory, "${DIR_JPEGLIB}", does not seem to exist.This must be corrected if the JPEG support is to be enabled.Either fix the pathname or disable the JPEG support.EOF } fi}checkZIP(){ if [ "${ZIP}" = yes ]; then test "`findHeader zlib.h`" || { cat<<EOFThe set of libtiff include directories, DIRS_LIBINC=${DIRS_LIBINC}does not seem to be setup correctly; "zlib.h" was not found.This must be corrected if the (G)ZIP support is to be enabled.Either fix the pathname or disable the (G)ZIP support.EOF } test $SRCDIR_IS_LIBTIFF = yes \ || test -d "${DIR_GZLIB:-/dev/null/no-such-file}" || { cat<<EOFThe libgz library directory, "${DIR_GZLIB}", does not seem to exist.This must be corrected if the ZIP support is to be enabled.Either fix the pathname or disable the ZIP support.EOF } fi}if [ $NONINTERACTIVE = no ] ; then ok=skip while [ "$ok" != y ] && [ "$ok" != yes ]; do if [ "$ok" != skip ]; then for i in 1 2 3 4 5 6; do promptForParameter $i; done fi printConfig; prompt "Are these ok [yes]?"; read ok test -z "$ok" && ok=yes case "$ok" in [1-9]|1[0-7]) promptForParameter $ok;; [yY]*|[nN]*) continue;; ?*) echo "" echo "\"y\", \"yes\", or <RETURN> accepts the displayed parameters." echo "A number lets you change the numbered parameter." echo "" ;; esac ok=skip done checkJPEG checkZIPelse checkJPEG checkZIPficase $MANSCHEME in*-source-*) MANAPPS=man1 MANLIB=man3;;*-nroff-*) MANAPPS=cat1 MANLIB=cat3;;esaccase $MANSCHEME in*-strip) MANSEDLOCAL="-e s/3T/3/g";;*) MANSEDLOCAL="";;esaccase $MANSCHEME in*-source-*) MANCVT='${MANSED} $? >$@';;*-nroff-gzip-*) MANCVT='${MANSED} $? | nroff -man | gzip > $@';;*-nroff-pack-*) MANCVT='${MANSED} $? | nroff -man | pack > $@';;*-nroff-com*-*) MANCVT='${MANSED} $? | nroff -man | compress > $@';;*-nroff-cat-*) MANCVT='${MANSED} $? | nroff -man > $@';;esaccase $MANSCHEME in*-0|*-0.gz|*-0.Z|*-gz|*-Z|*-z) suf=`echo $MANSCHEME | sed 's/.*-/./'` A='`echo $$i | sed' B='`' # workaround shell bugs MANAPPNAME="$A s/\\\\.1\$\$/$suf/$B" MANLIBNAME="$A s/\\\\.3t\$\$/$suf/$B" ;;*-strip) MANAPPNAME='$$i' MANLIBNAME='`echo $$i | sed s/\\.3t$$/.3/`' ;;*) MANAPPNAME='$$i' MANLIBNAME='$$i' ;;esacif [ "${JPEG}" = yes ]; then test -z "${CONF_JPEG-}" && CONF_JPEG="-DJPEG_SUPPORT" if test -z "${LIBJPEG-}" ; then LIBJPEG="-ljpeg" test -z "${DIR_JPEGLIB-}" || LIBJPEG="-L${DIR_JPEGLIB} ${LIBJPEG}" fi if [ "${OJPEG}" = yes ]; then CONF_JPEG="$CONF_JPEG -DOJPEG_SUPPORT" fielse CONF_JPEG= LIBJPEG=fiif [ "${ZIP}" = yes ]; then test -z "${CONF_ZIP-}" && CONF_ZIP="-DZIP_SUPPORT -DPIXARLOG_SUPPORT" if test -z "${LIBGZ-}" ; then LIBGZ="-lz" test -z "${DIR_GZLIB-}" || LIBGZ="-L${DIR_GZLIB} ${LIBGZ}" fielse CONF_ZIP= LIBGZ=fiif [ "${LARGEFILE}" = yes ]; then LFSOPTS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DUSE_64BIT_API=1"else LFSOPTS=fiNote ""## Fixup a list of potentially relative pathnames so# that they work when used in a subdirectory. The# string sent to stdout has no extraneous spaces so# it can be used, for example, in building pathnames.## NB: There's an extra echo done here so we get a# \n-terminated string passed to sed.#relativize(){ echo `if [ $SRCDIR_IS_LIBTIFF = no ]; then (for i do case "$i" in /*|-l*) echo "$i" ;; -[LR]) ;; # XXX??? -[LR]/*) echo "$i" ;; -L*) echo "$i" | sed 's;^-L;-L../;' ;; -R*) echo "$i" | sed 's;^-R;-R../;' ;; *) echo "../$i" ;; esac done) | tr '\012' ' ' else echo "$@" fi` | sed -e 's;[ ][ ]*$;;' -e 's;/[.]$;;'}## Generate a list of compiler include options,# prepending ``../'' to any relative pathnames.#makeIncArgs(){ (for i do case "$i" in /*) echo "-I$i" ;; *) if [ $SRCDIR_IS_LIBTIFF = yes ]; then echo "-I$i" else echo "-I../$i" fi ;; esac done) | tr '\012' ' '}## Setup parameters needed below.#if [ $SRCDIR_IS_LIBTIFF = yes ]; then CONFIGDIR="." LIBSRCDIR="${SRCDIR}"else CONFIGDIR=".." LIBSRCDIR=`relativize ${SRCDIR}`/libtifffi# NB: these should be sorted alphabeticallycat>>confsed<<EOFs;@AR@;${AR};gs;@AROPTS@;${AROPTS};gs;@CONFIGDIR@;${CONFIGDIR};gs;@CCOMPILER@;${CCOMPILER};gs;@CHMOD@;${CHMOD};gs;@CONF_JPEG@;${CONF_JPEG};gs;@CONF_ZIP@;${CONF_ZIP};gs;@COPT_LIBINC@;`makeIncArgs ${DIRS_LIBINC}`;gs;@DATE@;${DATE};gs;@DEPEND_JPEGLIB@;${CONF_JPEG:+`findHeader jpeglib.h` `findHeader jerror.h`};gs;@DEPEND_ZLIB@;${CONF_ZIP:+`findHeader zlib.h`};gs;@DIR_BIN@;${DIR_BIN};gs;@DIR_JPEGLIB@;`relativize ${DIR_JPEGLIB}`;gs;@DIR_GZLIB@;`relativize ${DIR_GZLIB}`;gs;@DIR_HTML@;${DIR_HTML};gs;@DIR_INC@;${DIR_INC};gs;@DIR_LIB@;${DIR_LIB};gs;@DIR_MAN@;${DIR_MAN};gs;@DIRS_LIBINC@;`relativize ${DIRS_LIBINC}`;gs;@DIST_POINT@;${DIST_POINT};gs;@DIST_MAJOR@;${DIST_MAJOR};gs;@DIST_MINOR@;${DIST_MINOR};gs;@DSO@;${DSO};gs;@DSOSUF@;${DSOSUF};gs;@DSOSUF_VERSION@;${DSOSUF_VERSION};gs;@ENVOPTS@;${ENVOPTS};gs;@FILLORDER@;${FILLORDER};gs;@GCOPTS@;${GCOPTS};gs;@HTML@;${HTML};gs;@INSTALL@;${INSTALL};gs;@LIBJPEG@;`relativize ${LIBJPEG}`;gs;@LIBGL@;${LIBGL};gs;@LIBGZ@;`relativize ${LIBGZ}`;gs;@LIBSRCDIR@;${LIBSRCDIR};gs;@LIBIMAGE@;${LIBIMAGE};gs;@LIBCOPTS@;${LIBCOPTS};gs;@LIBPORT@;${LIBPORT};gs;@LN@;${LN};gs;@LN_S@;${LN_S};gs;@LFSOPTS@;${LFSOPTS};gs;@MACHDEPLIBS@;${MACHDEPLIBS};gs;@MANAPPS@;${MANAPPS};gs;@MANAPPNAME@;${MANAPPNAME};gs;@MANLIBNAME@;${MANLIBNAME};gs;@MANCVT@;${MANCVT};gs;@MANSEDLOCAL@;${MANSEDLOCAL};gs;@MANLIB@;${MANLIB};gs;@MV_F@;${MV_F};gs;@OPTIMIZER@;${OPTIMIZER};gs;@PORT@;${PORT};gs;@PORTFUNCS@;${PORTFUNCS};gs;@RANLIB@;${RANLIB};gs;@SCRIPT_SH@;${SCRIPT_SH};gs;@SED@;${SED};gs;@SETMAKE@;${SETMAKE};gs;@SRCDIR@;${SRCDIR};gs;@RELSRCDIR@;`relativize ${SRCDIR}`;gs;@STRIP@;${STRIP};gs;@TARGET@;${TARGET};gs;@TIFFLIBREF@;${TIFFLIBREF};gs;@VERSION@;${VERSION};gs;@RELEASE@;${RELEASE};gs;@VERSIONFILE@;`relativize ${VERSIONFILE}`;gs;@RELEASE_DATE_FILE@;`relativize ${RELEASE_DATE_FILE}`;gs;@WARNING@;Warning, this file was automatically created by the TIFF configure script;gEOFSedConfigFiles(){ for F do test -f $SRCDIR/$F.in || { bitch "$SRCDIR/$F.in is missing; this should be part of the distribution." boom } dir=`echo $F | $SED 's;/[^/]*$;;'` if [ $dir != $F ] && [ ! -d $dir ]; then Note "Creating $dir directory" mkdir $dir fi suffix=`echo $F | $SED 's/.*\.//'` if [ "$suffix" = h ]; then # # Compare old and new versions so that include files # are only updated when something has changed--this # saves time for subsequent makes. Note we screen # out use of @DATE@ 'cuz otherwise that'll mess up # the comparison (this assumes dates are used in lines # of the form DATE: @DATE@). # $RM $F.new; $SED -f confsed $SRCDIR/$F.in > $F.new $RM confx; $SED '/DATE:/d' $F.new >confx $RM confy; $SED '/DATE:/d' $F >confy 2>/dev/null if cmp -s confx confy >/dev/null 2>&1; then $RM $F.new else Note "Creating $F from $SRCDIR/$F.in" $RM $F; mv $F.new $F; $CHMOD 444 $F fi else Note "Creating $F from $SRCDIR/$F.in" if $SED -f confsed $SRCDIR/$F.in >$F.new; then $RM $F; mv $F.new $F; $CHMOD 444 $F else cat 1>&2 <<EOFHelp, there was a problem crafting $F from $F.in.The command: $SED -f confsed $SRCDIR/$F.in >$F.newfailed. Aborting without cleaning up files so you can take a look...EOF exit 1 fi fi done}## port/install.sh is the SGI install program emulator script.#CONF_FILES="Makefile"if [ $SRCDIR_IS_LIBTIFF != yes ] ; then CONF_FILES="$CONF_FILES libtiff/Makefile man/Makefile tools/Makefile port/install.sh " test $HTML = yes && CONF_FILES="$CONF_FILES html/Makefile" test $PORT = yes && CONF_FILES="$CONF_FILES port/Makefile"fiSedConfigFiles $CONF_FILESNote "Done."$RM $JUNKexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -