configure
上传用户:weiyuanprp
上传日期:2020-05-20
资源大小:1169k
文件大小:135k
- Note " Found tiffio.h version ${header_ver}"
- Note " Found libtiff version ${lib_ver}"
- if [ ${header_ver} -ge 19960307 ]; then
- case ${lib_ver} in
- 3.4) tiff_runlen_t="uint16" ;;
- 3.[56789]) tiff_runlen_t="uint32" ;;
- esac
- fi
- else
- cat 1>&2 <<EOF
- Missing TIFF Library.
- Compilation of the following test program failed:
- ----------------------------------------------------------
- EOF
- cat t.c 1>&2
- cat 1>&2 <<EOF
- ----------------------------------------------------------
- TIFFINC=${OTIFFINC}
- LIBTIFF=${LIBTIFF}
- Verify that you have the TIFFINC and LIBTIFF configuration parameters
- set correctly for your system (see above) and that any environment
- variables are setup that are needed to locate a libtiff DSO at runtime
- (e.g. LD_LIBRARY_PATH). Also be sure that any relative pathnames are
- made relative to the top of the build area.
- EOF
- boom
- return 1
- fi
- if [ "${tiff_runlen_t}" != "" ]; then
- export tiff_runlen_t
- return 0
- else
- cat 1>&2 <<EOF
- Incompatible TIFF Library.
- HylaFAX ${VERSION} requires TIFF software distribution versions 3.4 through
- 3.9. If you do not have up to date TIFF software on your system
- then you can retrieve it from the location where you obtained this software.
- The Home Page for version 3.5 and later is http://www.libtiff.org
- EOF
- boom
- return 1
- fi
- }
- #
- # Check an existing port.h to see if it was created
- # for the target and compiler we're using.
- #
- CheckPortDotH()
- {
- getConfigTag TARGET port.h; target="$param"
- getConfigTag CCOMPILER port.h; ccompiler="$param"
- getConfigTag CXXCOMPILER port.h; cxxcompiler="$param"
- CCOMP=$CCOMPILER;
- test $ISGCC = yes && CCOMP="${CCOMP}-${GCCversion}"
- CXXCOMP=$CXXCOMPILER;
- test $ISGXX = yes && CXXCOMP="${CXXCOMP}-${GCCversion}"
- test "$target" = "$TARGET" &&
- test "$ccompiler" = "$CCOMP" &&
- test "$cxxcompiler" = "$CXXCOMP"
- }
- #
- # Built port.h and, optionally, termios.h based on
- # the system and compiler setup.
- #
- BuildPortDotH()
- {
- Note ""
- Note "Creating port.h with necessary definitions."
- (EmitCPlusPlusPrologue _PORT_
- EmitConfigurationDefinitions
- echo '#include <sys/types.h>'
- TYPES_H="sys/types.h"
- if CheckForIncludeFile sys/bsdtypes.h; then
- Note "... configure use of <sys/bsdtypes.h>"
- echo '#include <sys/bsdtypes.h>'
- TYPES_H="$TYPES_H sys/bsdtypes.h"
- fi
- CheckVarDecl uid_t 'typedef int uid_t;' $TYPES_H
- CheckVarDecl gid_t 'typedef int gid_t;' $TYPES_H
- CheckVarDecl mode_t 'typedef int mode_t;' $TYPES_H stdlib.h
- CheckVarDecl off_t 'typedef long off_t;' $TYPES_H stdlib.h
- CheckVarDecl pid_t 'typedef int pid_t;' $TYPES_H stdlib.h
- CheckVarDecl size_t 'typedef unsigned size_t;' $TYPES_H stdlib.h
- CheckVarDecl dev_t 'typedef int dev_t;' $TYPES_H stdlib.h
- if CheckForIncludeFile stdint.h; then
- Note "... configure use of <stdint.h>"
- echo '#define HAVE_STDINT_H 1'
- TYPES_H="$TYPES_H stdint.h"
- fi
- CheckVarDecl intptr_t 'typedef long intptr_t;' $TYPES_H
- if [ $CONFIG_OSFCNH = auto ]; then
- if CheckForIncludeFile osfcn.h; then
- CONFIG_OSFCNH=yes
- else
- CONFIG_OSFCNH=no
- fi
- fi
- if [ $CONFIG_OSFCNH = yes ]; then
- Note "... configure use of <osfcn.h>"
- echo '#define HAS_OSFCN_H 1'
- OSFCNH='osfcn.h'
- else
- OSFCNH=
- fi
- if CheckForIncludeFile sys/select.h; then
- Note "... configure use of <sys/select.h>"
- echo '#define HAS_SELECT_H 1'
- SELECTH='sys/select.h'
- else
- SELECTH=
- fi
- #
- # Check whether compiler uses new C++ header style
- #
- CheckForIncludeFile new || {
- Note "... configure use of new.h"
- echo '#define HAS_OLD_NEW_H 1'
- }
- #
- # Some vendors have changed the socket API so that
- # call-by-reference parameters that give buffer
- # lengths are not int; this must be dealt with to
- # get the code to compile. Note that we only emit
- # the define if the type is not an int; we do this
- # so Socket.h can include code that assumes the
- # default so folks don't have to rerun configure.
- #
- # The HP-UX case is a bit peculiar. There socklen_t
- # is defined as size_t, but in order to use it...
- # "To use UNIX95/98 style sockets in HP-UX, the libxnet
- # library needs to be added to the link line. Also, the
- # macro, _XOPEN_SOURCE, needs to be defined, and the
- # macro, _XOPEN_SOURCE_EXTENDED, needs to be defined as 1.
- # Refer to HP-UX manpage, xopen_networking(7) for further
- # details." Otherwise, we must define
- # CONFIG_HPUX_SOCKLEN_T_BRAINDAMAGE.
- #
- test "$CONFIG_SOCKARGLENTYPE" || { # int vs unsigned long vs ...
- case $TARGET in
- # XXX fill in for busted systems
- *-aix4*) CONFIG_SOCKARGLENTYPE=size_t;;
- *-hpux11*) CONFIG_SOCKARGLENTYPE=size_t;;
- *sysv4.2uw2*) CONFIG_SOCKARGLENTYPE=size_t;;
- *-univel-*) CONFIG_SOCKARGLENTYPE=size_t;;
- *-sysv5UnixWare*) CONFIG_SOCKARGLENTYPE=size_t;;
- *-sysv5OpenUNIX*) CONFIG_SOCKARGLENTYPE=size_t;;
- *-sysv5SCO_SV*) CONFIG_SOCKARGLENTYPE=size_t;;
- *-freebsd4*) CONFIG_SOCKARGLENTYPE=u_int32_t;;
- *-freebsd5*) CONFIG_SOCKARGLENTYPE=u_int32_t;;
- *) CONFIG_SOCKARGLENTYPE=int;;
- esac
- }
- TYPES_H="$TYPES_H sys/socket.h"
- CheckVarDecl socklen_t "typedef $CONFIG_SOCKARGLENTYPE socklen_t;" $TYPES_H
- #
- # Select signal handler type casts.
- #
- if [ $ISGXX = yes ]; then
- #
- # Must use -pendantic-errors with gcc to insure (sig_t) (...)
- # is treated as an error instead of a warning when searching
- # for the proper signal handler types below.
- #
- OGCXXOPTS="$GCXXOPTS"
- GCXXOPTS="$GCXXOPTS -pedantic-errors"
- makeDefs xdefs
- fi
- SIGHANDLERTYPES="
- $SIGHANDLERTYPES
- (sig_t)
- (SIG_PF)
- (void(*)(int))
- (void(*)())
- (int)
- "
- SIGHANDLERTYPE=
- for i in $SIGHANDLERTYPES; do
- CheckSigactionHandler "$i" && {
- SIGHANDLERTYPE="#define fxSIGACTIONHANDLER $i"
- Note "... use $i for sigaction handler type"
- break;
- }
- done
- # Only look for sigvec if we cannot find a sigaction() type
- if [ -z "$SIGHANDLERTYPE" ]; then
- for i in $SIGHANDLERTYPES; do
- CheckSigvecHandler "$i" && {
- SIGHANDLERTYPE="#define fxSIGVECHANDLER $i"
- Note "... use $i for sigvec handler type"
- break;
- }
- done
- fi
- echo $SIGHANDLERTYPE
- SIGHANDLERTYPE=
- for i in $SIGHANDLERTYPES; do
- CheckSignalHandler "$i" && {
- SIGHANDLERTYPE="#define fxSIGHANDLER $i"
- Note "... use $i for signal handler type"
- break;
- }
- done
- echo $SIGHANDLERTYPE
- if [ $ISGXX = yes ]; then
- GCXXOPTS="$OGCXXOPTS"
- makeDefs xdefs
- fi
- CheckForMMAP && {
- echo '#define HAS_MMAP 1'
- Note "... configure use of mmap for memory-mapped files"
- CheckFuncDecl mmap
- 'extern void* mmap(void*, size_t, int, int, int, off_t);' sys/mman.h
- CheckFuncDecl munmap 'extern int munmap (caddr_t, int);' sys/mman.h
- }
- CheckFuncDecl bzero 'extern void bzero(void *, int);' string.h
- CheckFuncDecl mkstemp 'extern int mkstemp(char *);' stdlib.h stdio.h unistd.h
- CheckFuncDecl strerror 'extern char* strerror(int);' string.h
- CheckFuncDecl strncasecmp
- 'extern int strncasecmp(const char*, const char*, size_t);' string.h
- CheckFuncDecl strcasecmp
- 'extern int strcasecmp(const char*, const char*);' string.h
- CheckFuncDecl strdup 'extern char* strdup(const char*);' string.h
- CheckFuncDecl memset 'extern void* memset(void*, int, size_t);' string.h
- CheckFuncDecl getpass 'extern char* getpass(const char *);' stdlib.h unistd.h
- CheckFuncDecl random 'extern long random(void);' math.h stdlib.h
- CheckFuncDecl srandom 'extern void srandom(int);' math.h stdlib.h
- CheckFuncDecl floor 'extern double floor(double);' math.h
- CheckFuncDecl waitpid 'extern pid_t waitpid(pid_t, int *, int);' sys/wait.h
- CheckForFunc sysconf && {
- echo '#define HAS_SYSCONF 1'
- Note "... configure use of sysconf"
- CheckFuncDecl sysconf 'extern long sysconf(int);' unistd.h
- }
- CheckForFunc ulimit && {
- echo '#define HAS_ULIMIT 1'
- Note "... configure use of ulimit"
- CheckFuncDecl ulimit 'extern long ulimit(int, ...);' ulimit.h
- }
- CheckForFunc getdtablesize && {
- echo '#define HAS_GETDTABLESIZE 1'
- Note "... configure use of getdtablesize"
- CheckFuncDecl getdtablesize 'extern int getdtablesize(void);' unistd.h
- }
- CheckDefine _POSIX_OPEN_MAX '_POSIX_OPEN_MAX 16' limits.h
- CheckDefine howmany 'howmany(x, y) (((x)+((y)-1))/(y))' $TYPES_H
- CheckForFuncDecl sigvec signal.h || {
- echo 'struct sigvec;'
- AddFuncDecl sigvec
- 'extern int sigvec(int, const struct sigvec*, struct sigvec*);'
- }
- CheckForFuncDecl sigaction signal.h || {
- echo 'struct sigaction;'
- AddFuncDecl sigaction
- 'extern int sigaction(int, const struct sigaction*, struct sigaction*);'
- }
- CheckFuncDecl kill 'extern int kill(pid_t, int);' signal.h
- CheckFuncDecl close 'extern int close(int);' unistd.h
- CheckFuncDecl getuid 'extern uid_t getuid(void);' unistd.h
- CheckFuncDecl geteuid 'extern uid_t geteuid(void);' unistd.h
- CheckFuncDecl seteuid 'extern int seteuid(uid_t);' unistd.h
- CheckFuncDecl setegid 'extern int setegid(gid_t);' unistd.h
- CheckFuncDecl setenv 'int setenv(const char *, const char *, int);' stdlib.h
- CheckFuncDecl ftruncate 'extern int ftruncate(int, off_t);' unistd.h
- CheckFuncDecl getdtablesize 'extern int getdtablesize(void);' unistd.h
- CheckFuncDecl chroot 'extern int chroot(const char *path);' unistd.h
- #
- # unistd.h is where many people put it
- # sys/select.h is for USL-derived code
- # sys/time.h is for HP systems (sigh)
- # sys/types.h is for yet other systems (sigh sigh)
- #
- CheckForFuncDecl select unistd.h $SELECTH sys/time.h $TYPES_H || {
- echo 'struct fd_set;'
- echo 'struct timeval;'
- AddFuncDecl select
- 'extern int select(int,struct fd_set*,struct fd_set*,struct fd_set*,struct timeval*);'
- }
- CheckFuncDecl unlink 'extern int unlink(const char*);' unistd.h
- CheckFuncDecl read 'extern int read(int, const void*, unsigned int);' unistd.h
- CheckFuncDecl ioctl 'extern int ioctl(int, int, ...);' unistd.h sys/ioctl.h
- CheckForFunc fchown && {
- echo '#define HAS_FCHOWN 1'
- Note "... configure use of fchown"
- CheckFuncDecl fchown 'extern int fchown(int, uid_t, gid_t);' unistd.h
- }
- CheckFuncDecl gethostname 'extern int gethostname(char*, int);' unistd.h $OSFCNH
- CheckFuncDecl malloc 'extern void* malloc(size_t);' stdlib.h
- CheckFuncDecl realloc 'extern void* realloc(void*, size_t);' stdlib.h
- CheckFuncDecl free 'extern void free(void*);' stdlib.h
- CheckFuncDecl strtoul
- 'extern unsigned long strtoul(const char*, char**, int);' stdlib.h
- #
- # unistd.h is for sco3.2v4.[0-2] and GNU libc (yech!)
- #
- CheckFuncDecl getopt
- 'extern int getopt(int, char* const*, const char*);' stdlib.h unistd.h
- CheckFuncDecl isatty 'extern int isatty(int);' stdlib.h unistd.h
- CheckVarDecl 'char.*optarg' 'extern char* optarg;' stdlib.h unistd.h
- CheckVarDecl 'int.*opterr' 'extern int opterr;' stdlib.h unistd.h
- CheckVarDecl 'int.*optind' 'extern int optind;' stdlib.h unistd.h
- CheckFuncDecl system 'extern int system(const char*);' stdlib.h
- CheckFuncDecl mktemp 'extern char* mktemp(char*);' stdlib.h stdio.h unistd.h
- CheckStdio popen 'extern FILE* popen(const char *, const char *);'
- CheckStdio pclose 'extern int pclose(FILE*);'
- CheckStdio fdopen 'extern FILE* fdopen(int, const char*);'
- CheckStdio snprintf 'extern int snprintf(char*, size_t, const char*,...);'
- CheckForFuncDecl vsnprintf stdio.h || {
- echo '#include <stdarg.h>'
- AddFuncDecl vsnprintf 'extern int vsnprintf(char*, size_t, const char*, va_list);'
- }
- CheckForDefine fileno stdio.h || {
- CheckStdio fileno 'extern int fileno(FILE*);'
- }
- CheckFuncDecl opendir 'extern DIR* opendir(const char*);' dirent.h
- CheckFuncDecl syslog 'extern void syslog(int, const char*, ...);' syslog.h
- CheckForFuncDecl vsyslog syslog.h || {
- echo '#include <stdarg.h>'
- AddFuncDecl vsyslog 'extern void vsyslog(int, const char*, va_list);'
- }
- CheckFuncDecl closelog 'extern void closelog(void);' syslog.h
- CheckFuncDecl openlog 'extern void openlog(const char*, int, int);' syslog.h
- CheckForFunc fchmod && {
- echo '#define HAS_FCHMOD 1'
- Note "... configure use of fchmod"
- CheckFuncDecl fchmod 'extern int fchmod(int, mode_t);'
- unistd.h libc.h $OSFCNH sys/stat.h
- }
- CheckFuncDecl mknod 'extern int mknod(const char*, mode_t, dev_t);'
- unistd.h sys/stat.h
- CheckForFuncDecl gettimeofday sys/time.h || {
- echo 'struct timezone;'
- echo 'struct timeval;'
- AddFuncDecl gettimeofday
- 'extern int gettimeofday(struct timeval*, struct timezone*);'
- }
- CheckForFuncDecl strftime time.h || {
- echo 'struct tm;'
- AddFuncDecl strftime
- 'extern size_t strftime(char*,size_t,const char*,const struct tm*);'
- }
- CheckForFuncDecl localtime time.h || {
- echo 'struct tm;'
- AddFuncDecl localtime 'struct tm* localtime(const time_t* clock);'
- }
- CheckForTimeZoneHandling && {
- echo '#define HAS_TM_ZONE 1'
- Note "... configure use of struct tm timezone information"
- }
- CheckForFuncDecl setitimer sys/time.h || {
- echo '#ifdef ITIMER_REAL'
- echo 'struct itimerval;'
- AddFuncDecl setitimer
- 'extern int setitimer(int,struct itimerval*,struct itimerval*);'
- echo '#endif'
- }
- CheckFuncDecl setpwent 'extern void setpwent(void);' pwd.h
- CheckFuncDecl endpwent 'extern void endpwent(void);' pwd.h
- CheckFuncDecl getpwnam 'extern struct passwd* getpwnam(const char*);' pwd.h
- case "$TARGET" in
- *-reno*)
- ;;
- *)
- for i in toupper tolower; do
- CheckFuncDecl $i "extern int $i(int);" ctype.h
- done
- ;;
- esac
- CheckForIncludeFile net/errno.h && {
- Note "... configure use of <net/errno.h>"
- echo '#define HAS_NETERRNO_H 1'
- }
- CheckForFuncDecl getpeername sys/socket.h || {
- echo 'struct sockaddr;'
- AddFuncDecl getpeername 'extern int getpeername(int,struct sockaddr*,int*);'
- }
- CheckForFuncDecl getsockname sys/socket.h || {
- echo 'struct sockaddr;'
- AddFuncDecl getsockname 'extern int getsockname(int,struct sockaddr*,int*);'
- }
- CheckFuncDecl socket 'extern int socket(int, int, int);' sys/socket.h
- CheckFuncDecl connect 'extern int connect(int, const void*, int);' sys/socket.h
- CheckForFuncDecl bind sys/socket.h || {
- echo 'struct sockaddr;'
- AddFuncDecl bind 'extern int bind(int, const struct sockaddr*, int);'
- }
- CheckFuncDecl listen 'extern int listen(int, int);' sys/socket.h
- CheckFuncDecl getsockopt
- 'extern int getsockopt(int, int, int, const char*, int*);' sys/socket.h
- CheckFuncDecl setsockopt
- 'extern int setsockopt(int, int, int, const char*, int);' sys/socket.h
- CheckForFuncDecl accept sys/socket.h || {
- echo 'struct sockaddr;'
- AddFuncDecl accept 'extern int accept(int, struct sockaddr*, int*);'
- }
- CheckFuncDecl send
- 'extern int send(int, const void*, int, int);' sys/socket.h
- CheckFuncDecl setutent 'extern void setutent(void);' utmp.h
- CheckFuncDecl endutent 'extern void endutent(void);' utmp.h
- CheckForFuncDecl getutent utmp.h || {
- echo 'struct utmp;'
- AddFuncDecl getutent 'extern struct utmp* getutent(void);'
- }
- CheckForFuncDecl pututline utmp.h || {
- echo 'struct utmp;'
- AddFuncDecl pututline
- 'extern struct utmp* pututline(const struct utmp*);'
- }
- CheckForFuncDecl gethostbyname netdb.h || {
- echo 'struct hostent;'
- AddFuncDecl gethostbyname
- 'extern struct hostent* gethostbyname(const char*);'
- }
- CheckForFuncDecl gethostbyaddr netdb.h || {
- echo 'struct hostent;'
- AddFuncDecl gethostbyaddr
- 'extern struct hostent* gethostbyaddr(const void*, int, int);'
- }
- CheckForFuncDecl getservbyname netdb.h || {
- echo 'struct servent;'
- AddFuncDecl getservbyname
- 'extern struct servent* getservbyname(const char*, const char*);'
- }
- CheckForDefine LOCK_SH sys/file.h || {
- AddDefine LOCK_SH 'LOCK_SH 1 /* shared lock */'
- AddDefine LOCK_EX 'LOCK_EX 2 /* exclusive lock */'
- AddDefine LOCK_NB 'LOCK_NB 4 /* dont block when locking */'
- AddDefine LOCK_UN 'LOCK_UN 8 /* unlock */'
- }
- CheckFuncDecl flock 'extern int flock(int, int);' sys/file.h
- CheckForFuncDecl sigsetjmp setjmp.h || {
- echo '#include <setjmp.h>'
- echo '#ifndef sigsetjmp'
- AddDefine sigjmp_buf 'sigjmp_buf jmp_buf /* hopefully compatible */'
- AddFuncDecl sigsetjmp 'extern int sigsetjmp(sigjmp_buf, int);'
- AddFuncDecl siglongjmp 'extern void siglongjmp(sigjmp_buf, int);'
- echo '#endif'
- }
- CheckForFuncDecl inet_ntoa arpa/inet.h || {
- echo 'struct in_addr;'
- AddFuncDecl inet_ntoa 'extern char* inet_ntoa(struct in_addr);'
- }
- CheckForIncludeFile sys/mkdev.h && {
- Note "... configure use of <sys/mkdev.h> (for SVR4-style lock files)"
- echo '#define HAS_MKDEV 1'
- }
- CheckForIncludeFile locale.h && {
- Note "... configure use of <locale.h> (internationalization support)"
- echo '#define HAS_LOCALE 1'
- }
- CheckForIncludeFile langinfo.h && {
- Note "... configure use of <langinfo.h> (internationalization support)"
- echo '#define HAS_LANGINFO 1'
- }
- CheckForIncludeFile paths.h && {
- Note "... configure use of <paths.h>"
- echo '#include <paths.h>'
- }
- CheckForIncludeFile sys/modem.h && {
- Note "... configure use of <sys/modem.h>"
- echo '#define HAS_MODEM_H 1'
- }
- CheckForIncludeFile sys/termiox.h && {
- case $TARGET in
- *-*-sco3.2v5.*) ;;
- *) Note "... configure use of SVR4 termiox support"
- echo '#define HAS_TERMIOX 1'
- ;;
- esac
- }
- CheckForFunc flock || {
- #
- # Emit the necessary #defines for emulating flock
- #
- if CheckForFunc fcntl; then
- echo '#define HAS_FCNTL 1'
- fi
- if CheckForFunc lockf; then
- echo '#define HAS_LOCKF 1'
- fi
- }
- # NB: logwtmp checked above when looking for -lutil
- test $HAS_LOGWTMP = yes && {
- #
- # Configure use of logwtmp in the BSD getty support and
- # verify that the accompanying logout function is present
- # also. Note that we put out proper declarations for the
- # functions since they don't appear to be declared anywhere.
- #
- echo '#define HAS_LOGWTMP 1'
- Note "... configure use of logwtmp (BSD-style wtmp logging)"
- CheckForFuncDecl logwtmp utmp.h || {
- AddFuncDecl logwtmp
- 'int logwtmp(const char*, const char*, const char*);'
- }
- CheckForLibrary logout -lutil && {
- echo '#define HAS_LOGOUT 1'
- Note "... configure use of logout (BSD-style utmp support)"
- CheckForFuncDecl logout utmp.h || {
- AddFuncDecl logout 'int logout(const char*);'
- }
- }
- }
- CheckDefine _PATH_DEV '_PATH_DEV "/dev/"' paths.h
- CheckDefine _PATH_DEVNULL '_PATH_DEVNULL "/dev/null"' paths.h
- CheckDefine _PATH_TMP '_PATH_TMP "/tmp/"' paths.h
- if [ $UTMP = auto ]; then
- if CheckForIncludeFile utmpx.h; then
- case $TARGET in
- *-hpux10.20*) UTMP=utmp;;
- *-hpux11*) UTMP=utmp;;
- *-aix4*) UTMP=utmp;;
- *-aix5*) UTMP=utmp;;
- *-dec-osf4.0*) UTMP=utmp;;
- *-osf-5.1a*) UTMP=utmp;;
- *-linux*) UTMP=utmp;;
- *) UTMP=utmpx;;
- esac
- else
- UTMP=utmp;
- fi
- fi
- if [ $UTMP = utmpx ]; then
- Note "... configure use of <utmpx.h> (extended utmp interface)"
- echo '#define HAS_UTMPX 1'
- CheckForDefine _PATH_WTMPX paths.h utmp.h utmpx.h || {
- if CheckForDefine WTMPX_FILE utmpx.h; then
- AddDefine _PATH_WTMPX '_PATH_WTMPX WTMPX_FILE'
- else
- PATHWTMPX=`findFile wtmpx /etc:/var/adm:/usr/adm`
- test "$PATHWTMPX" && {
- AddDefine _PATH_WTMPX "_PATH_WTMPX "${PATHWTMPX}""
- }
- fi
- }
- #
- # struct exit_status is defined for all systems with
- # utmpx support, but SVR4.0.3 headers define the extended
- # exit status structure *within* struct utmp and then reuse
- # it within struct utmpx. This does not work for all
- # compilers so we must look for this case and, if present,
- # enable a workaround declaration of struct exit_status (sigh).
- #
- if CheckForStructExitStatus utmpx '#include <utmpx.h>'; then
- echo '#define HAS_UTEXIT 1'
- echo '#define HAS_EXIT_STATUS 1'
- elif CheckForStructExitStatus utmpx
- 'struct exit_status { short e_termination; short e_exit; };'
- '#include <utmpx.h>'; then
- Note "... add declaration for struct exit_status"
- echo '#define HAS_UTEXIT 1'
- echo '#define HAS_EXIT_STATUS 0'
- fi
- else
- Note "... configure use of <utmp.h> (normal utmp interface)"
- CheckForDefine _PATH_UTMP paths.h utmp.h || {
- if CheckForDefine UTMP_FILE utmp.h; then
- AddDefine _PATH_UTMP '_PATH_UTMP UTMP_FILE'
- else
- PATHUTMP=`findFile utmp /etc:/var/adm:/usr/adm`
- test "$PATHUTMP" && {
- AddDefine _PATH_UTMP "_PATH_UTMP "${PATHUTMP}""
- }
- fi
- }
- CheckForStructExitStatus utmp && {
- Note "... configure use of extended exit status in utmp"
- echo '#define HAS_UTEXIT 1'
- }
- CheckForDefine _PATH_WTMP paths.h utmp.h || {
- if CheckForDefine WTMP_FILE utmp.h; then
- AddDefine _PATH_WTMP '_PATH_WTMP WTMP_FILE'
- else
- PATHWTMP=`findFile wtmp /etc:/var/adm:/usr/adm`
- test "$PATHWTMP" && {
- AddDefine _PATH_WTMP "_PATH_WTMP "${PATHWTMP}""
- }
- fi
- }
- fi
- CheckForDefine RT_NOCHANGE sys/priocntl.h sys/rtpriocntl.h &&
- CheckForDefine TS_NOCHANGE sys/priocntl.h sys/tspriocntl.h && {
- case $TARGET in
- *-*-sco3.2v5.*) ;;
- *) Note "... configure use of SVR4 realtime process control interface"
- echo '#define HAS_PRIOCNTL 1'
- ;;
- esac
- }
- CheckForDefine FP_NOCHANGE sys/priocntl.h sys/fppriocntl.h && {
- Note "... called FP instead of RT"
- echo '#define HAS_FPPRIOCNTL 1'
- }
- CheckForDefine NDPRI sys/schedctl.h && {
- Note "... configure use of IRIX realtime process control interface"
- echo '#define HAS_SCHEDCTL 1'
- }
- CheckForDefine RTPRIO_RTOFF sys/rtprio.h && {
- Note "... configure use of HP-UX realtime process control interface"
- echo '#define HAS_RTPRIO 1'
- }
- CheckForPositiveDefine _POSIX_PRIORITY_SCHEDULING unistd.h sched.h && {
- Note "... configure use of POSIX realtime process control interface"
- echo '#define HAS_POSIXSCHED 1'
- case $TARGET in
- *-*-sco3.2v5.*) echo '#define RT_PRIORITY 96';;
- *-linux*) echo '#define RT_PRIORITY 1';;
- *) echo '#define RT_PRIORITY 1';;
- esac
- }
- CheckForTXCD && {
- Note "... configure use of TXADDCD and TXDELCD ioctls"
- echo '#define HAS_TXCD 1'
- }
- if CheckForIncludeFile crypt.h; then
- Note "... configure use of <crypt.h>"
- echo '#define HAS_CRYPT_H 1'
- CheckFuncDecl crypt 'extern const char* crypt(const char*, const char*);' unistd.h crypt.h
- else
- CheckFuncDecl crypt 'extern const char* crypt(const char*, const char*);' unistd.h stdlib.h
- fi
- CheckTermioFuncDecls termios.h
- if CheckLibtiff; then
- Note "... add declaration for tiff_runlen_t"
- echo "#define tiff_runlen_t ${tiff_runlen_t}"
- fi
- if [ "x$PAMLIBS" != "x" ]; then
- CheckPAMType
- fi
- CheckForDefine s6_addr32 net/if.h || {
- case $TARGET in
- *-*-sysv5*) AddDefine s6_addr32 's6_addr32 S6_un.S6_l' ;;
- sparc-sun-*) AddDefine s6_addr32 's6_addr32 S6_un.S6_l' ;;
- esac
- }
- # Emit the version variable that port will always give us.
- echo "extern const char* HYLAFAX_VERSION_STRING;"
- EmitCPlusPlusEpilogue
- )>xport.h
- mv xport.h port.h; chmod 444 port.h
- Note "Done creating port.h."
- }
- if test -f port.h && CheckPortDotH; then
- Note ""
- Note "Using previously created port.h."
- else
- $RM xport.h xtermios.h t.c t.c++ a.out port.h termios.h
- BuildTermiosDotH
- BuildPortDotH
- fi
- Note ""
- Note "Checking system libraries for functionality to emulate."
- FUNCS="
- flock
- ftruncate
- setegid
- seteuid
- setvbuf
- strcasecmp
- writev
- "
- for i in $FUNCS; do
- CheckForFunc $i || {
- Note "... emulate $i"
- PORTFUNCS="$PORTFUNCS $i.c"
- }
- done
- FUNCS="
- random
- "
- for i in $FUNCS; do
- CheckForStdFunc $i || {
- Note "... emulate $i"
- PORTFUNCS="$PORTFUNCS $i.c"
- }
- done
- #
- # Now for those functions that need args.
- #
- CheckForUnistdFunc getopt "0, (void*)0, (void*)0" || {
- Note "... emulate getopt"
- PORTFUNCS="$PORTFUNCS getopt.c"
- }
- CheckForStdioFunc snprintf "(void*)0, 0, (void*)0" || {
- Note "... emulate snprintf"
- PORTFUNCS="$PORTFUNCS snprintf.c"
- }
- CheckForFunc vsnprintf "(void*)0, 0, (void*)0, (void*)0" || {
- Note "... emulate vsnprintf"
- PORTFUNCS="$PORTFUNCS vsnprintf.c"
- }
- CheckForFunc mkstemp "(void*)0" || {
- Note "... emulate mkstemp"
- PORTFUNCS="$PORTFUNCS mkstemp.c"
- }
- CheckForFunc setenv "(void*)0, (void*)0, 0" || {
- Note "... emulate setenv"
- PORTFUNCS="$PORTFUNCS setenv.c"
- }
- CheckForStdFunc srandom "0" || {
- Note "... emulate srandom"
- PORTFUNCS="$PORTFUNCS srandom.c"
- }
- CheckForStdFunc strtod "(void*)0, (void*)0" || {
- Note "... emulate strtod"
- PORTFUNCS="$PORTFUNCS strtod.c"
- }
- CheckForStdFunc strtoul "(void*)0, (void*)0, 0" || {
- Note "... emulate strtoul"
- PORTFUNCS="$PORTFUNCS strtoul.c"
- }
- #
- # SCO OS 5 #defines syslog as another function
- # so it is necessary to include syslog.h when
- # checking if the function is present in the
- # library (sigh).
- #
- CheckForSyslog()
- {
- (echo '#include <syslog.h>';
- echo '#include <stdlib.h>';
- echo '#include "port.h"';
- echo 'main(){syslog(0,"foo");exit(0);}') >t.c
- capture cat t.c
- runMake t "t:; ${CC} t.c ${MACHDEPLIBS}"
- }
- CheckForVSyslog()
- {
- (echo '#include <syslog.h>';
- echo '#include <stdarg.h>';
- echo '#include <stdlib.h>';
- echo '#include "port.h"';
- echo 'main(){va_list ap; vsyslog(0,"foo", ap);exit(0);}') >t.c
- capture cat t.c
- runMake t "t:; ${CC} t.c ${MACHDEPLIBS}"
- }
- if CheckForSyslog; then
- CheckForVSyslog || {
- Note "... emulate vsyslog"
- PORTFUNCS="$PORTFUNCS vsyslog.c"
- }
- else
- Note "... emulate syslog&co."
- PORTFUNCS="$PORTFUNCS syslog.c"
- fi
- LIBPORT='${PORT}/libport.a'
- Note "Done checking system libraries."
- Note ""
- Note "Checking ZLIB support."
- #
- # Verify library is compatible.
- #
- cat>t.c<<EOF
- #include <stdlib.h>
- #include <stdio.h>
- #include "zlib.h"
- main()
- {
- if (strcmp(ZLIB_VERSION, "0.95") < 0) { /* include file version */
- printf("old include files: version %un", ZLIB_VERSION);
- exit(-1);
- }
- if (strncmp(zlib_version, ZLIB_VERSION, 4) != 0) {
- printf("library/header file incompatibility: %s %sn",
- zlib_version, ZLIB_VERSION);
- exit(-1);
- } else {
- exit(0);
- }
- }
- EOF
- capture cat t.c
- if runMake t "t:; ${CC} ${CVERSION} ${OZLIBINC} t.c ${LIBZ} ${MACHDEPLIBS}" && capture ./a.out; then
- ZLIBINC="${OZLIBINC}"
- if [ -n "$OZLIBINC" ]; then
- Note "Using ZLIB include files from $OZLIBINC"
- fi
- Note "Using pre-built ZLIB library $LIBZ"
- else
- LIBZ=
- DIRS="/usr/local /opt/zlib"
- for i in $DIRS; do
- if runMake t "t:; ${CC} ${CVERSION} -I${i}/include t.c -L${i}/lib -lz ${MACHDEPLIBS}" && capture ./a.out; then
- OZLIBINC="-I${i}/include"
- ZLIBINC="-I${i}/include"
- LIBZ="-L${i}/lib -lz"
- Note "Using ZLIB include files from ${i}/include"
- Note "Using pre-built ZLIB library $LIBZ"
- break
- fi
- done
- if [ -z "$LIBZ" ]; then
- cat 1>&2 <<EOF
- Incompatible/missing ZLIB Library.
- Compilation or execution of the following test program failed:
- ----------------------------------------------------------
- EOF
- cat t.c 1>&2
- cat 1>&2 <<EOF
- ----------------------------------------------------------
- With the following directories tried:
- DIRS=<default compiler search path> ${DIRS}
- The above program checks the version of the ZLIB library to ensure it
- is suitable for use with HylaFAX. HylaFAX ${VERSION} requires a recent
- ZLIB software distribution; version 0.95 or newer. If you have the right
- software, verify that you have the ZLIBINC(location of zlib.h) and
- LIBZ(location of libz.a/libz.so) configuration parameters set correctly
- for your system and that any environment variables are setup that are
- needed to locate a libz DSO at runtime (e.g. LD_LIBRARY_PATH).
- Also be sure that any relative pathnames are made relative to the top of
- the build area.
- EOF
- boom
- fi
- fi
- Note "Done checking ZLIB support."
- Note ""
- Note "Checking TIFF support."
- #
- # Location of TIFF binaries
- #
- if [ -z "$TIFFBIN" ]; then
- DIRS="/opt/local/bin /usr/local/bin /usr/contrib/bin /usr/gnu/bin /usr/bin"
- for i in $DIRS; do
- test -x $i/tiff2ps && { TIFFBIN=$i; break; }
- done
- fi
- if [ -z "$TIFFBIN" ]; then
- cat 1>&2 <<EOF
- Cannot locate the TIFF binary files(ie tiff2ps) anywhere.
- Please install the TIFF binaries and set the TIFFBIN parameter
- to the correct path.
- EOF
- boom
- else
- Note "Using TIFF binary files from $TIFFBIN"
- fi
- HAVE_JBIGTIFF="/*#define HAVE_JBIGTIFF 1*/"
- if [ "$DISABLE_JBIG" != "yes" ]; then
- Note "Checking JBIG-in-TIFF conversion support."
- exec 3>&2 2> /dev/null # Mute stderr, tiffcp may segfault here
- $TIFFBIN/tiffcp -c g4 misc/jbig.tif misc/foo.tif > /dev/null 2>&1
- EV=$?
- exec 2>&3 3>&- # Restore stderr
- if [ $EV = 0 ]; then
- $TIFFBIN/tiffcp misc/jbig.tif misc/foo.tif > /dev/null
- if [ -n "`$TIFFBIN/tiffinfo misc/foo.tif | grep 'Fax DCS'`" ]; then
- HAVE_JBIGTIFF="#define HAVE_JBIGTIFF 1"
- Note "JBIG-in-TIFF conversion support found."
- else
- Note "JBIG-in-TIFF fax support not found."
- fi
- else
- Note "JBIG-in-TIFF conversion support not found."
- fi
- rm -f misc/foo.tif
- fi
- Note "Done checking TIFF support."
- if [ "$DSO" = auto ] || [ "$DSO" = yes ]; then
- Note ""
- Note "Checking for Dynamic Shared Object (DSO) support."
- case $DSO-$TARGET in
- *-*-irix*)
- if (findApp rld /lib:/usr/lib:$PATH) >/dev/null 2>&1; then
- DSOSUF=so
- DSOOPTS="${CVERSION} -shared -rdata_shared -check_registry ${DEPTH}/${SRCDIR}/port/irix/so_locations -quickstart_info"
- DSODELAY=-delay_load
- LLDOPTS='-rpath ${LIBEXEC}'
- DSO=IRIX
- CheckCCDSO()
- {
- $RM t.c t.o t.${DSOSUF}
- echo 'int f() { return 0; }'>t.c
- capture cat t.c
- runMake t
- 't.o:; ${CCF} -c t.c'
- "t: t.o; ${CCF} ${DSOOPTS} -o t.${DSOSUF} t.o"
- }
- CheckCXXDSO()
- {
- $RM t.c++ t.o t.${DSOSUF}
- echo 'int f() { return 0; }'>t.c++
- capture cat t.c++
- runMake t
- "t.o:; ${C++F} -c ${C++FILE} t.c++${MAKECXXOVERRIDE}"
- "t:t.o; ${C++F} ${DSOOPTS} -o t.${DSOSUF} t.o"
- }
- else
- Note "No runtime loader found, looks like your system does not supports DSOs."
- DSO=no
- fi
- ;;
- *-*-linux*)
- if [ "X${DIR_LIB}" != "X/usr/lib" ] && [ "X${DIR_LIB}" != "X/usr/lib64" ]; then
- USE_RPATH=' -Wl,-rpath,${LIBDIR}'
- else
- USE_RPATH=''
- fi
- DSOSUF=so.$VERSION
- LIBFAXSERVER='${FAXD}/'$LIBFAXSERVER
- FAXD='${DEPTH}/faxd'
- DSOOPTS='-shared -fpic -Wl,-soname,$@'
- LLDOPTS='-L${UTIL} -L${FAXD} '$LIBUTIL$USE_RPATH
- GCOPTS="${GCOPTS} -fpic"
- GCXXOPTS="${GCXXOPTS} -fpic"
- DSO=LINUX
- CheckCCDSO()
- {
- $RM t.c t.o t.${DSOSUF}
- echo 'int f() { return 0; }'>t.c
- capture cat t.c
- runMake t
- 't.o:; ${CCF} -c t.c'
- "t: t.o; ${CCF} ${DSOOPTS} -o t.${DSOSUF} t.o"
- }
- CheckCXXDSO()
- {
- $RM t.c++ t.o t.${DSOSUF}
- echo 'int f() { return 0; }'>t.c++
- capture cat t.c++
- runMake t
- "t.o:; ${C++F} -c ${C++FILE} t.c++${MAKECXXOVERRIDE}"
- "t:t.o; ${C++F} ${DSOOPTS} -o t.${DSOSUF} t.o"
- }
- ;;
- # There has been a fair amount of back-and-forth on Solaris DSO defaults
- # because it always seems to be that there is some Solaris version out there
- # that won't work right, and it causes more trouble than it's worth.
- # So it's defaulted to "no" since it's the path of least-resistance and the
- # value of the DSO usage is rather small.
- auto-*-solaris*)
- Note "Automatic DSO usage on Solaris is disabled. Use --with-DSO=yes to enable."
- DSO=no
- ;;
- yes-*-solaris*)
- if [ "X${DIR_LIB}" != "X/usr/lib" ]; then
- USE_RPATH=' -R${LIBDIR}'
- else
- USE_RPATH=''
- fi
- DSOSUF=so
- LIBUTIL=''
- FAXD='${DEPTH}/faxd'
- LIBFAXSERVER='-L${FAXD} -lfaxserver'
- # options here are passed directly to ld, not through g++ first
- if [ ${ISGCC} = "yes" ] ; then
- DSOOPTS='-shared -Wl,-G,-h,$@'
- LLDOPTS='-L${UTIL} -L${FAXD} -R${LIBDIR} -lfaxutil -lstdc++'
- GCOPTS="${GCOPTS} -fpic"
- GCXXOPTS="${GCXXOPTS} -fpic"
- else
- DSOOPTS='-G -h $@'
- LLDOPTS='-L${UTIL} -L${FAXD} -R${LIBDIR} -lfaxutil -lCrun'
- GCOPTS="${GCOPTS} -Kpic"
- GCXXOPTS="${GCXXOPTS} -Kpic"
- fi
- #LLDOPTS='-L${UTIL} -L${FAXD} -R${LIBDIR} -lfaxutil'
- DSO=SOLARIS
- CheckCCDSO()
- {
- $RM t.c t.o t.${DSOSUF}
- echo 'int f() { return 0; }'>t.c
- capture cat t.c
- runMake t
- 't.o:; ${CCF} -c t.c'
- "t: t.o; ${CCF} ${DSOOPTS} -o t.${DSOSUF} t.o"
- }
- CheckCXXDSO()
- {
- $RM t.c++ t.o t.${DSOSUF}
- echo 'int f() { return 0; }'>t.c++
- capture cat t.c++
- runMake t
- "t.o:; ${C++F} -c ${C++FILE} t.c++${MAKECXXOVERRIDE}"
- "t:t.o; ${C++F} ${DSOOPTS} -o t.${DSOSUF} t.o"
- }
- ;;
- *-sysv5*)
- if [ "X${DIR_LIB}" != "X/usr/lib" ]; then
- USE_RPATH=' -R${LIBDIR}'
- else
- USE_RPATH=''
- fi
- DSOSUF=so
- FAXD='${DEPTH}/faxd'
- LIBFAXSERVER='-L${FAXD} -lfaxserver'
- # options here are passed to CC, not directly to ld
- DSOOPTS='-G -Wl,-h,$@'
- if [ ${ISGCC} = "yes" ] ; then
- LLDOPTS='-L${UTIL} -L${FAXD} -R${LIBDIR} -lfaxutil -lstdc++'
- GCOPTS="${GCOPTS} -fpic"
- GCXXOPTS="${GCXXOPTS} -fpic"
- else
- LLDOPTS='-L${UTIL} -L${FAXD} -R${LIBDIR} -lfaxutil'
- GCOPTS="${GCOPTS} -Kpic"
- GCXXOPTS="${GCXXOPTS} -Kpic"
- fi
- #LLDOPTS='-L${UTIL} -L${FAXD} -R${LIBDIR} -lfaxutil'
- DSO=SYSV5
- CheckCCDSO()
- {
- $RM t.c t.o t.${DSOSUF}
- echo 'int f() { return 0; }'>t.c
- capture cat t.c
- runMake t
- 't.o:; ${CCF} -c t.c'
- "t: t.o; ${CCF} ${DSOOPTS} -o t.${DSOSUF} t.o"
- }
- CheckCXXDSO()
- {
- $RM t.c++ t.o t.${DSOSUF}
- echo 'int f() { return 0; }'>t.c++
- capture cat t.c++
- runMake t
- "t.o:; ${C++F} -c ${C++FILE} t.c++${MAKECXXOVERRIDE}"
- "t:t.o; ${C++F} ${DSOOPTS} -o t.${DSOSUF} t.o"
- }
- ;;
- *) Note "There is no support for building HylaFAX as DSOs on your system."
- DSO=no
- ;;
- esac
- if [ "$DSO" != no ]; then
- JUNK="$JUNK t.${DSOSUF}"
- # We need the new shared/DSO OPTS/FLAGS
- makeDefs xdefs
- if CheckCCDSO; then
- if CheckCXXDSO; then
- Note "Looks like your system supports $DSO-style DSOs."
- else
- cat 1>&4 <<EOF
- Looks like your system supports DSOs...
- ... but $CXXCOMPILER does not support them in the expected way.
- EOF
- DSO=no
- fi
- else
- cat 1>&4 <<EOF
- Looks like your system supports DSOs...
- ... sigh, but $CCOMPILER does not support them in the expected way.
- EOF
- DSO=no
- fi
- fi
- elif [ "$DSO" != no ]; then
- Note ""
- Note "Looks like your system supports $DSO-style DSOs."
- fi
- if [ "$DSO" = no ]; then
- MAKEDSOINCLUDE='#'
- DSOSUF=a DSOOPTS= DSODELAY= LLDOPTS=
- else
- MAKEDSOINCLUDE="$MAKEINCLUDE"
- fi
- Note ""
- Note "Selecting programs used during installation and operation."
- if [ -z "$AWK" ]; then
- # we need an awk that supports functions and -v
- CheckAwk()
- {
- (set -x; $1 -v BAR=bar '
- function foo(x) {
- print "GOT" x
- }
- BEGIN { foo(BAR) }
- ' </dev/null | grep GOTbar) >&5 2>&1
- return
- }
- for i in mawk nawk gawk awk; do
- x=`findApp $i $PATH`
- if test "$x" && CheckAwk "$x"; then
- AWK=$x
- break
- fi
- done
- fi
- if [ -z "$AWK" ]; then
- AWK=awk
- Note ""
- Note "WARNING, could not locate a suitable AWK for processing the command"
- Note " scripts included in this software distribution; using $AWK."
- else
- Note "Looks like $AWK should be used in command scripts."
- fi
- test "$SED" || SED=`findApp sed $PATH`
- if [ -z "$SED" ]; then
- SED=sed
- Note "WARNING, could not locate a suitable SED command; using $SED."
- fi
- test "$PATH_SENDMAIL" ||
- PATH_SENDMAIL=`findApp sendmail $PATH:/usr/lib:/usr/ucblib`
- if [ -z "$PATH_SENDMAIL" ]; then
- cat<<EOF
- WARNING, could not locate sendmail on your system.
- Beware that the mail notification work done by this software uses
- sendmail-specific command line options. If you do not have a
- sendmail-compatible mailer things will break.
- EOF
- PATH_SENDMAIL=/usr/lib/sendmail
- Note "Using $PATH_SENDMAIL to deliver mail."
- else
- Note "Looks like $PATH_SENDMAIL should be used to deliver mail."
- fi
- #
- # Miscellaneous ``little'' programs. We want absolute
- # pathnames so that work done by the super-user (e.g.
- # installation) is safer.
- #
- test "$CAT" || CAT=`findAppDef cat $PATH cat`
- test "$CHGRP" || CHGRP=`findAppDef chgrp $PATH chgrp`
- test "$CHMOD" || CHMOD=`findAppDef chmod $PATH chmod`
- test "$CHOWN" || CHOWN=`findAppDef chown $PATH chown`
- test "$CMP" || CMP=`findAppDef cmp $PATH cmp`
- test "$COL" || COL=`findAppDef col $PATH col`
- test "$CP" || CP=`findAppDef cp $PATH cp`
- test "$ECHO" || ECHO=`findAppDef echo $PATH echo`
- test "$FILECMD" || FILECMD=`findAppDef file $PATH file`
- test "$FUSER" || FUSER=`findAppDef fuser /sbin:$PATH fuser`
- test "$GENDIST" || GENDIST=`findAppDef gendist $PATH gendist`
- test "$GREP" || GREP=`findAppDef grep $PATH grep`
- test "$LN" || LN=`findAppDef ln $PATH ln`
- test "$MAN" || MAN=`findAppDef man $PATH man`
- test "$MIMENCODE" || MIMENCODE=`findAppDef mimencode $PATH mimencode`
- test "$MIMENCODE" || MIMENCODE=`findAppDef base64-encode $PATH base64-encode`
- test "$MIMENCODE" || MIMENCODE=`findAppDef base64 $PATH base64`
- test "$MKDIR" || MKDIR=`findAppDef mkdir $PATH mkdir`
- test "$MV" || MV=`findAppDef mv $PATH mv`
- test "$PCL6CMD" || PCL6CMD=`findAppDef pcl6 $PATH pcl6`
- test "$PWDCMD" || PWDCMD=`findAppDef pwd $PATH pwd`
- test "$RMCMD" || RMCMD=`findAppDef rm $PATH rm`
- test "$SORT" || SORT=`findAppDef sort $PATH sort`
- test "$STRIP" || STRIP=`findAppDef strip $PATH strip`
- test "$TIFF2PDF" || TIFF2PDF=`findAppDef tiff2pdf $PATH bin/tiff2pdf`
- test "$TTYCMD" || TTYCMD=`findAppDef tty $PATH tty`
- test "$UUENCODE" || UUENCODE=`findAppDef uuencode $PATH uuencode`
- test "$UUENCODE" || UUENCODE=`findAppDef gmime-uuencode $PATH gmime-uuencode`
- #
- # Test/verify we know how to create FIFO special files.
- #
- $RM conffifo;
- if capture mkfifo conffifo && test -p conffifo >/dev/null 2>&1; then
- Note "Looks like $MKFIFO creates FIFO special files."
- elif test -f conffifo; then # NB: not everyone has test -p
- Note "Looks like $MKFIFO creates FIFO special files (unable to verify)."
- else
- # NB: we can't be certain of this because on some systems
- # only root can create a FIFO special file
- Note "WARNING, $MKFIFO may create FIFO special files, but testing failed."
- fi
- #
- # Check if mv -f is supported
- #
- if [ -z "$MV_F" ]; then
- $RM t.c; echo "">t.c
- if capture $MV -f t.c t.o; then
- Note "Looks like $MV supports the -f option to force a move."
- MV_F=-f
- else
- Note "WARNING, looks like $MV has no -f option to force move operations;"
- Note " this may cause problems during installation."
- MV_F=
- fi
- fi
- #
- # Check if ln -s creates a symbolic link.
- #
- if [ -z "$LN_S" ]; then
- capture "$RM t.c; $LN -s foo t.c" && LN_S=-s
- fi
- if [ -n "$LN_S" ]; then
- Note "Looks like $LN supports the -s option to create a symbolic link."
- else
- Note "WARNING, looks like $LN has no -s option to create symbolic links;"
- Note " this may cause problems during installation."
- fi
- #
- # Check if uuencode supports base64 encoding.
- #
- if [ -z "$ENCODING" ]; then
- if [ -x "$MIMENCODE" ]; then
- ENCODING=base64
- Note "Looks like $MIMENCODE supports base64 encoding."
- elif [ -x "$UUENCODE" ]; then
- if capture "$UUENCODE -m port.h foo"; then
- ENCODING=base64
- Note "Looks like $UUENCODE supports base64 encoding."
- else
- ENCODING=x-uuencode
- Note "Looks like $UUENCODE does not support base64 encoding."
- fi
- fi
- fi
- #
- # Pick install mechanism.
- #
- if [ -z "$INSTALL" ]; then
- case $TARGET in
- *-irix*) INSTALL=`findApp install /sbin:$PATH`;;
- *) INSTALL='${SHELL} ${PORT}/install.sh';;
- esac
- fi
- # Location SysV style init scripts
- if [ -z "$DIR_SYSVINIT" ]; then
- DIR_SYSVINITS="
- /etc/rc.d/init.d
- /etc/init.d
- "
- case $TARGET in
- *-sunos*) DIR_SYSVINITS="$DIR_SYSVINITS $DIR_SBIN";;
- *-hpux*) DIR_SYSVINITS="/sbin/init.d $DIR_SYSVINITS";;
- *-dec-osf*) DIR_SYSVINITS="/sbin/init.d $DIR_SYSVINITS";;
- *) ;;
- esac
- DIR_SYSVINIT=
- for i in $DIR_SYSVINITS; do
- test -d $i && { DIR_SYSVINIT=$i; break; }
- done
- fi
- if [ "$SYSVINIT" = auto ]; then
- if test -d "$DIR_SYSVINIT"; then
- SYSVINIT=yes
- Note "Looks like a SysV-style init is used, enabling installation of startup code."
- else
- SYSVINIT=no
- fi
- fi
- if [ "$SYSVINIT" = yes ]; then
- Note "Looks like SysV init scripts go in $DIR_SYSVINIT."
- fi
- if [ "$SYSVINIT" = yes ]; then
- if [ -z "$DIR_SYSVINITSTART" ]; then
- case $TARGET in
- *-linux*) DIR_SYSVINITSTART="../rc2.d ../rc3.d ../rc4.d ../rc5.d";;
- *) DIR_SYSVINITSTART="../rc2.d";;
- esac
- fi
- if [ -z "$DIR_SYSVINITSTOP" ]; then
- case $TARGET in
- *-linux*) DIR_SYSVINITSTOP="../rc0.d ../rc1.d ../rc6.d";;
- *-solaris*) DIR_SYSVINITSTOP="../rc0.d ../rc1.d ../rcS.d";;
- *sysv4.2uw2*) DIR_SYSVINITSTOP="../rc0.d ../rc1.d";;
- *-sysv5UnixWare*) DIR_SYSVINITSTOP="../rc0.d ../rc1.d";;
- *-sysv5OpenUNIX*) DIR_SYSVINITSTOP="../rc0.d ../rc1.d";;
- *-sysv5SCO_SV*) DIR_SYSVINITSTOP="../rc0.d ../rc2.d";;
- *) DIR_SYSVINITSTOP="../rc0.d";;
- esac
- fi
- if [ -z "$NAME_SYSVINITSTART" ]; then
- case $TARGET in
- *-hpux*) NAME_SYSVINITSTART="S905hylafax" ;;
- *-linux*) NAME_SYSVINITSTART="S97hylafax" ;;
- *-*-sco3.2v5*) NAME_SYSVINITSTART="S90hylafax" ;;
- *) NAME_SYSVINITSTART="S80hylafax" ;;
- esac
- fi
- if [ -z "$NAME_SYSVINITSTOP" ]; then
- case $TARGET in
- *-hpux*) NAME_SYSVINITSTOP="K095hylafax" ;;
- *-solaris*) NAME_SYSVINITSTOP="K20hylafax" ;;
- *) NAME_SYSVINITSTOP="K05hylafax" ;;
- esac
- fi
- fi
- # now to keep from breaking etc/Makefile
- if [ -z "$DIR_SYSVINITSTART" ]; then
- DIR_SYSVINITSTART="dir_sysvinitstart_set_to_non_null_string"
- fi
- if [ -z "$DIR_SYSVINITSTOP" ]; then
- DIR_SYSVINITSTOP="dir_sysvinitstop_set_to_non_null_string"
- fi
- Note "Done selecting programs."
- #
- # User-changable configuration parameters section.
- # Anything selected here is presented to the user
- # and may be interactively changed.
- #
- Note ""
- Note "Selecting default HylaFAX configuration parameters."
- Note ""
- #
- # Fill in any other configuration parameters not
- # setup in the site and local files.
- #
- #
- # Fax user GID
- #
- if [ -z "$FAXGID" ]; then
- case $TARGET in
- *-aix*) FAXGID=uucp;;
- *-bsdi*) FAXGID=uucp;;
- *freebsd2.1*) FAXGID=uucp; break;; # Not sure when this changed..
- *bsd*) FAXGID=dialer;;
- *-hpux*) FAXGID=sys;;
- *-irix*) FAXGID=nuucp;;
- *-isc*) FAXGID=uucp;;
- *-linux*) FAXGID=uucp;;
- *-*-sco*) FAXGID=uucp;;
- *-solaris*) FAXGID=uucp;;
- *-sunos*) FAXGID=uucp;;
- *-sysv4*) FAXGID=uucp;;
- *-sysv5*) FAXGID=uucp;;
- *-ultrix*) FAXGID=uucp;;
- *)
- FAXGID=uucp
- for i in uucp dialer nuucp sys; do
- grep "^${i}:" /etc/group >/dev/null 2>&1 && { FAXGID=$i; break; }
- done
- ;;
- esac
- fi
- Note "Using uid $FAXUID and gid $FAXGID for controlling access to fax stuff."
- #
- # System installation group ID.
- #
- if [ -z "$SYSGID" ]; then
- case $TARGET in
- *-aix*) SYSGID=sys;;
- *netbsd*) SYSGID=wheel;;
- *bsd*) SYSGID=bin;;
- *-hpux*) SYSGID=bin;;
- *-irix*) SYSGID=sys;;
- *-isc*) SYSGID=sys;;
- *-linux*) SYSGID=bin;;
- *-*-sco*) SYSGID=sys;;
- *-solaris*) SYSGID=sys;;
- *-sunos*) SYSGID=bin;;
- *-sysv4*) SYSGID=sys;;
- *-sysv5*) SYSGID=sys;;
- *-ultrix*) SYSGID=bin;;
- *)
- SYSGID=sys
- for i in sys bin; do
- grep "^${i}:" /etc/group >/dev/null 2>&1 && { SYSGID=$i; break; }
- done
- ;;
- esac
- fi
- Note "Using uid $SYSUID and gid $SYSGID for installing programs."
- if [ -z "$FILLORDER" ]; then
- #
- # Host bit order within a word.
- #
- case $TARGET in
- mips-dec-*) FILLORDER=LSB2MSB;;
- i[3-6]86-*) FILLORDER=LSB2MSB;;
- *) FILLORDER=MSB2LSB;;
- esac
- fi
- CPU=`echo $TARGET | sed 's/-.*//'`
- Note "Using $FILLORDER bit order for your $CPU cpu."
- # SVR4 packaging stuff
- if [ -z "$PKG_ARCH" ]; then
- PKG_ARCH=$CPU
- fi
- #
- # Style of getty support.
- #
- if [ "$GETTY" = auto ]; then
- case $TARGET in
- *bsd*) GETTY=BSD;;
- *-sunos*) GETTY=BSD;;
- *-ultrix*) GETTY=BSD;;
- *darwin*) GETTY=BSD;;
- *) GETTY=SysV;;
- esac
- fi
- Note "Looks like you need $GETTY getty support."
- if [ -z "$PATH_GETTY" ]; then
- if CheckForDefine _PATH_GETTY paths.h; then
- Note "Using _PATH_GETTY from <paths.h> as the program to exec for a data call."
- else
- #
- # NB: use findFile instead of findApp because on some
- # systems this file is mode 544; so if configure
- # is run by an unprivileged user the file will not
- # be located.
- #
- PATH_GETTY=`findFile ttymon /usr/lib/saf:/usr/libexec:/sbin:$PATH`
- test -z "$PATH_GETTY" &&
- PATH_GETTY=`findApp agetty /usr/libexec:/sbin:$PATH`
- test -z "$PATH_GETTY" &&
- PATH_GETTY=`findApp mgetty /usr/libexec:/sbin:$PATH`
- test -z "$PATH_GETTY" &&
- PATH_GETTY=`findApp getty /usr/libexec:/sbin:$PATH`
- if [ -z "$PATH_GETTY" ]; then
- PATH_GETTY=/etc/getty
- Note ""
- Note "WARNING, could not locate a suitable getty program to exec for a"
- Note " data call; using a default value $PATH_GETTY."
- Note ""
- else
- Note "Looks like $PATH_GETTY is the program to exec for a data call."
- fi
- fi
- else
- Note "Using $PATH_GETTY as the program to exec for a data call."
- fi
- # vgetty support
- if [ -z "$PATH_VGETTY" ]; then
- PATH_VGETTY=`findApp vgetty /usr/libexec:/sbin:$PATH`
- if [ -z "$PATH_VGETTY" ]; then
- PATH_VGETTY=/bin/vgetty
- Note "WARNING, no vgetty program found to handle a voice call, using $PATH_VGETTY."
- else
- Note "Looks like $PATH_VGETTY is the program to exec for a voice call."
- fi
- else
- Note "Using $PATH_VGETTY as the program to exec for a voice call."
- fi
- # egetty support
- if [ -z "$PATH_EGETTY" ]; then
- PATH_EGETTY=`findApp egetty /usr/libexec:/sbin:$PATH`
- if [ -z "$PATH_EGETTY" ]; then
- PATH_EGETTY=/bin/egetty
- Note "WARNING, no egetty program found, using $PATH_EGETTY."
- else
- Note "Looks like $PATH_EGETTY is the program to exec for an extern call."
- fi
- else
- Note "Using $PATH_EGETTY as the program to exec for an extern call."
- fi
- #
- # UUCP lock file type and location.
- #
- if [ "$LOCKS" = auto ]; then
- case $TARGET in
- *-aix*) LOCKS=ascii;;
- *-*-sco*) LOCKS="-ascii";;
- *-sysv2*) LOCKS=binary;;
- *-hpux*) LOCKS=binary;;
- *-sysv4*) LOCKS="+ascii";;
- *-sysv5*) LOCKS="-ascii";;
- *-solaris*) LOCKS="+ascii";;
- *-freebsd*) LOCKS=ascii;;
- *-netbsd*) LOCKS=ascii;;
- *bsd*) LOCKS=binary;;
- *) LOCKS=ascii;;
- esac
- fi
- Note "Looks like you use ${LOCKS}-style UUCP lock files."
- if [ -z "$DIR_LOCKS" ]; then
- LOCKDIRS="
- /var/spool/locks
- /usr/spool/locks
- /var/spool/lock
- /usr/spool/lock
- /var/spool/uucp
- /usr/spool/uucp
- "
- case $TARGET in
- *-aix*) LOCKDIRS="/etc/locks $LOCKDIRS";;
- *-linux*) LOCKDIRS="/var/lock/uucp /var/lock $LOCKDIRS";;
- *-*-sco*) LOCKDIRS="/usr/spool/uucp $LOCKDIRS";;
- *-*-sysv5*) LOCKDIRS="/usr/spool/uucp $LOCKDIRS";;
- esac
- DIR_LOCKS=
- for i in $LOCKDIRS; do
- test -d $i && { DIR_LOCKS=$i; break; }
- done
- fi
- if [ -z "$DIR_LOCKS" ]; then
- DIR_LOCKS=/var/spool/uucp
- Note "WARNING, could not locate a directory for UUCP lock files,"
- Note "guessing that UUCP lock files go in $DIR_LOCKS."
- else
- Note "Looks like UUCP lock files go in $DIR_LOCKS."
- fi
- bitchExecutable()
- {
- echo ""
- echo "WARNING, $1 does not seem to be an executable program;"
- echo " you may need to correct this before starting up the fax server."
- ls -lL $1
- echo ""
- }
- #
- # PostScript package and RIP location.
- #
- PickRIP()
- {
- if [ -z "$PATH_GSRIP" ]; then
- GSLOCS="
- /opt/local/bin/gs
- /usr/local/bin/gs
- /usr/contrib/bin/gs
- /usr/gnu/bin/gs
- /opt/gnu/bin/gs
- /usr/bin/gs
- /usr/sfw/bin/gs
- "
- for i in $GSLOCS; do
- # verify Ghostscript was linked with the tiffg3 device driver
- capture "$i -h 2>&1 | grep tiffg3" && { PATH_GSRIP=$i; break; }
- done
- fi
- case $PS in
- dps) PATH_PSRIP=$PATH_DPSRIP;;
- imp) PATH_PSRIP=$PATH_IMPRIP;;
- gs) PATH_PSRIP=$PATH_GSRIP;;
- esac
- }
- CheckRIP()
- {
- if [ -x "$PATH_PSRIP" ]; then
- if [ $PS = gs ]; then
- # verify Ghostscript was linked with the tiffg3 device driver
- capture "$PATH_PSRIP -h 2>&1 | grep tiffg3" || cat<<EOF
- WARNING, no tiffg3 driver in $PATH_PSRIP.
- The PostScript imaging program $PATH_PSRIP does not appear to be
- to be configured with the tiffg3 device driver. This is necessary for the
- fax software to operate correctly. See the documentation for information
- on building Ghostscript with the necessary TIFF driver.
- EOF
- fi
- elif [ -n "$PATH_PSRIP" ]; then
- bitchExecutable $PATH_PSRIP
- else
- cat<<EOF
- WARNING, no PostScript imaging program.
- No suitable PostScript imaging program was located on your system.
- This may be due to your not having Ghostscript installed or not having
- Ghostscript configured with the tiffg3 device driver. A default pathname
- will be used for the moment. You must correct this situation for the
- fax software to operate correctly. See the WWW documentation for information
- on building Ghostscript with the necessary TIFF driver.
- EOF
- PATH_PSRIP=/usr/local/bin/gs
- PATH_GSRIP=$PATH_PSRIP
- fi
- }
- if [ "$PS" = auto ]; then
- case $TARGET in
- *-irix*) if expr $RELEASE >= 6.2 >/dev/null; then
- PS=gs;
- else
- PS=dps;
- fi
- ;;
- *) PS=gs;;
- esac
- fi
- Note "Looks like the $PS imager package should be used."
- PickRIP
- Note "Looks like $PATH_PSRIP is the PostScript RIP to use."
- CheckRIP
- #
- # Ghostscript Fontmap File
- #
- getGSFonts()
- {
- if [ ! "$PS" = gs ] && [ -n $PATH_PSRIP ];then
- return 1
- fi
- $PATH_PSRIP -h | $AWK -F '[ ]' '
- BEGIN { start = 0; }
- /Search path:/ { start = 1 }
- {
- if (start == 1) {
- if ($1 == "") {
- gsub(" ","")
- gsub("^[.]","")
- gsub("^:","")
- printf "%s", $0
- } else if ($1 != "Search") start = 0
- }
- }
- '
- return 0
- }
- case $TARGET in
- *-freebsd*) PATH_AFM=/usr/local/lib/afm ;;
- *) if [ -z "$FONTMAP" ]; then
- FONTMAP=`getGSFonts`;
- fi
- ;;
- esac
- Note "Setting the Fontmap path to $FONTMAP"
- #
- # Location of Adobe Font Metric files.
- #
- if [ -z "$PATH_AFM" ]; then
- # if the fontmap path is available use that
- # else just guess
- if [ -n "$FONTMAP" ]; then
- PATH_AFM=$FONTMAP
- else
- DIR_AFMS="
- /usr/lib/afm
- /opt/local/lib/afm
- /usr/local/lib/afm
- /usr/local/share/ghostscript/fonts
- /usr/local/lib/ghostscript/fonts
- /usr/share/ghostscript/fonts
- /usr/gnu/lib/ghostscript/fonts
- /opt/gnu/lib/ghostscript/fonts
- /usr/lib/ghostscript/fonts
- /usr/lib/gnu/ghostscript/fonts
- "
- case $TARGET in
- *-irix*) DIR_AFMS="/usr/lib/DPS/AFM $DIR_AFMS";;
- *-bsdi*) DIR_AFMS="/usr/contrib/lib/flexfax/afm $DIR_AFMS";;
- *-sunos*) DIR_AFMS="/usr/openwin/lib/fonts/afm $DIR_AFMS";;
- esac
- PATH_AFM=
- for i in $DIR_AFMS; do
- test -d $i && { PATH_AFM=$i; break; }
- done
- fi
- fi
- if [ -z "$PATH_AFM" ]; then
- # put it where ghostscript normally puts things
- PATH_AFM=/usr/local/lib/ghostscript/fonts
- Note "WARNING, could not locate a directory with font metric information,"
- Note "guessing that font metric information goes in $PATH_AFM."
- else
- Note "Looks like font metric information goes in $PATH_AFM."
- fi
- #
- # Setup manual page-related stuff.
- #
- # Manual pages are processed according to:
- # 1. Section organization (BSD or System V)
- # 2. Pre-formatted (w/ nroff) or source.
- # 3. Compressed (compress, gzip, pack) or uncompressed.
- # 4. Whether or not the FlexFAX ``F'' suffix must be
- # stripped for pages to be found (only for 4F pages).
- #
- if [ -z "$DIR_MAN" ]; then
- MANPATH="
- $MANPATH
- /usr/local/man
- /usr/contrib/man
- /usr/catman/local
- "
- DIR_MAN=
- for i in $MANPATH; do
- test -d $i && { DIR_MAN=$i; break; }
- done
- test -z "$DIR_MAN" && DIR_MAN=/usr/local/man
- fi
- Note "Looks like manual pages go in $DIR_MAN."
- if [ -z "$MANSCHEME" ]; then
- case $TARGET in
- *-bsdi*|*-netbsd*) MANSCHEME=bsd-nroff-gzip-0.gz;;
- *-freebsd*) MANSCHEME=bsd-source-cat;;
- *-linux*) MANSCHEME=bsd-source-cat;;
- *-ultrix*) MANSCHEME=bsd-source-cat;;
- *-sunos*) MANSCHEME=bsd-source-cat-strip;;
- *-sysv[2345]*) MANSCHEME=sysv-source-cat-strip;;
- *-hpux*) MANSCHEME=sysv-source-cat-strip;;
- *-solaris*) MANSCHEME=sysv-source-cat-strip;;
- *-aix*) MANSCHEME=sysv-source-strip;;
- *-isc*|*-*-sco*) MANSCHEME=sysv-source-cat;;
- *-irix*) MANSCHEME=sysv-nroff-compress-Z;;
- *)
- #
- # Try to deduce the setup from existing manual pages.
- # XXX needs more work XXX
- #
- MANSCHEME=sysv-source-cat
- if [ -d /usr/share/man ]; then
- if [ -d /usr/share/man/u_man ]; then
- MANSCHEME=sysv-source-cat
- elif [ -d /usr/share/man/man8 ]; then
- MANSCHEME=bsd-source-cat
- fi
- elif [ -d /usr/share/catman ]; then
- if [ -d /usr/share/catman/u_man ]; then
- MANSCHEME=sysv-nroff-cat
- elif [ -d /usr/share/catman/man8 ]; then
- MANSCHEME=bsd-nroff-cat
- fi
- fi
- ;;
- esac
- fi
- Note "Looks like manual pages should be installed with $MANSCHEME."
- #
- # Figure out which brand of echo we have and define
- # prompt and print shell functions accordingly.
- #
- if [ `echo foo\c`@ = "foo@" ]; then
- prompt()
- {
- 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"
- }
- #
- # Prompt the user for a numeric value.
- #
- promptForNumericParameter()
- {
- 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/[ ]*$//'`
- match=`expr "$x" : "([0-9]*)"`
- if [ "$match" != "$x" ]; then
- echo ""
- echo "This must be entirely numeric; please correct it."
- echo ""
- x="";
- fi
- else
- x="$val"
- fi
- done
- param="$x"
- }
- promptForImagerPackage()
- {
- x=""
- while [ -z "$x" ]; do
- prompt "PostScript imager package [$PS]?"; read x
- if [ "$x" ]; then
- # strip leading and trailing white space
- x=`echo "$x" | sed -e 's/^[ ]*//' -e 's/[ ]*$//'`
- case "$x" in
- [dD]ps|DPS) x="dps";;
- [gG]s|[gG]host[sS]cript) x="gs";;
- imp) x="imp";;
- *)
- cat <<EOF
- "$x" is not a PostScript imager package; choose one of:
- dps for Display PostScript on a Silicon Graphics machine running
- any version of IRIX *prior* to 6.2
- gs for the freely available Ghostscript package
- imp for Impressario 2.1 on a Silicon Graphics machine
- EOF
- x="";;
- esac
- else
- x="$PS"
- fi
- done
- PS="$x"
- }
- promptForPageSize()
- {
- file=$1 x=""
- while [ -z "$x" ]; do
- prompt "Default page size [$PAGESIZE]?"; read x
- if [ "$x" ]; then
- # strip leading and trailing white space
- x=`echo "$x" | sed -e 's/^[ ]*//' -e 's/[ ]*$//'`
- # search pagesizes file for an entry
- y=`sed -e '/^#/d' $file | grep -i "$x" | sed -e 's/ .*//;q'`
- if [ -z "$y" ]; then
- cat<<EOF
- "$x" is not a known page size; the following are known page sizes:
- Name Abbrev Width Height Width Height Top Left
- EOF
- sed -e '/^#/d' -e '/@DEFPAGESIZE@/d' $file
- echo ""
- x=""
- else
- x="$y"
- fi
- else
- x="$PAGESIZE"
- fi
- done
- PAGESIZE="$x"
- }
- #
- # Prompt the user for a numeric value.
- #
- promptForVRes()
- {
- x=""
- while [ -z "$x" ]; do
- prompt "Default vertical res (lpi) [$DEFVRES]?"; read x
- if [ "$x" ]; then
- # strip leading and trailing white space
- x=`echo "$x" | sed -e 's/^[ ]*//' -e 's/[ ]*$//'`
- case "$x" in
- 98|low|med*) x="98";;
- 196|high|fine) x="196";;
- *)
- cat <<EOF
- "$x" is not a valid vertical resolution; choose either "98" lines/inch
- (low resolution) or "196" lines/inch (often called fine resolution).
- EOF
- x="";;
- esac
- else
- x="$DEFVRES"
- fi
- done
- DEFVRES="$x"
- }
- promptForUUCPLockScheme()
- {
- x=""
- while [ -z "$x" ]; do
- prompt "UUCP lock file scheme [$LOCKS]?"; read x
- if [ "$x" ]; then
- # strip leading and trailing white space
- x=`echo "$x" | sed -e 's/^[ ]*//' -e 's/[ ]*$//'`
- case "$x" in
- ascii|[-+]ascii) ;;
- binary|[-+]binary) ;;
- *)
- cat <<EOF
- "$x" is not a valid UUCP lock file scheme; choose "ascii" or
- "binary" to get lock files with the process ID of the lock holder
- written as ASCII or binary values and optionally prefix this with
- "+" for SVR4-style lock file names (LK.xxx.yyy.zzz) or "-" for
- SCO-style lock file names (convert tty names from upper to lower
- case when forming the lock file name).
- EOF
- x="";;
- esac
- else
- x="$LOCKS"
- fi
- done
- LOCKS="$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 are
- constructed 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 organization
- sysv-source-cat-strip nroff source for SysV w/o .4f suffix
- sysv-source-cat nroff source for SysV as-is
- EOF
- x="";;
- esac
- else
- x="$MANSCHEME"
- fi
- done
- MANSCHEME="$x"
- }
- getPageSizeInfo()
- {
- pat=`grep '^default' $1 |
- sed -e 's/default[ ]*//' -e 's/[ ][ ]*/[ ]*/g'`
- param=`grep "$pat" $1 | sed -e 's/ .*//;q'`
- }
- printConfig1()
- {
- cat<<EOF
- HylaFAX configuration parameters (part 1 of 2) are:
- [ 1] Directory for applications: $DIR_BIN
- [ 2] Directory for lib data files: $DIR_LIBDATA
- [ 3] Directory for lib executables: $DIR_LIBEXEC
- [ 4] Directory for system apps: $DIR_SBIN
- [ 5] Directory for manual pages: $DIR_MAN
- [ 6] Directory for spooling: $DIR_SPOOL
- [ 7] Directory for uucp lock files: $DIR_LOCKS
- [ 8] Uucp lock file scheme: $LOCKS
- [ 9] PostScript imager package: $PS
- [10] PostScript imager program: $PATH_PSRIP
- [11] Manual page installation scheme: $MANSCHEME
- [12] Default page size: $PAGESIZE
- [13] Default vertical res (lpi): $DEFVRES
- EOF
- }
- printConfig2()
- {
- cat<<EOF
- HylaFAX configuration parameters (part 2 of 2) are:
- [14] Location of getty program: $PATH_GETTY
- [15] Location of voice getty program: $PATH_VGETTY
- [16] Location of sendmail program: $PATH_SENDMAIL
- [17] Location of TIFF tools: $TIFFBIN
- [18] Location of SysV init scripts: $DIR_SYSVINIT
- [19] Location of SysV start scripts: $DIR_SYSVINITSTART
- [20] Location of SysV stop scripts: $DIR_SYSVINITSTOP
- [21] Name of SysV start script: $NAME_SYSVINITSTART
- [22] Name of SysV stop script: $NAME_SYSVINITSTOP
- [23] Init script starts faxq: $FAXQ_SERVER
- [24] Init script starts hfaxd $HFAXD_SERVER
- [25] Start paging protocol: $HFAXD_SNPP_SERVER
- EOF
- }
-
- promptForParameter()
- {
- case $1 in
- 1) promptForNonNullStringParameter "$DIR_BIN"
- "Directory to install applications"; DIR_BIN="$param"
- ;;
- 2) promptForNonNullStringParameter "$DIR_LIBDATA"
- "Directory to install library data files"; DIR_LIBDATA="$param"
- ;;
- 3) promptForNonNullStringParameter "$DIR_LIBEXEC"
- "Directory to install library executables"; DIR_LIBEXEC="$param"
- ;;
- 4) promptForNonNullStringParameter "$DIR_SBIN"
- "Directory to install system apps"; DIR_SBIN="$param"
- ;;
- 5) promptForNonNullStringParameter "$DIR_MAN"
- "Directory to install manual pages"; DIR_MAN="$param"
- ;;
- 6) promptForNonNullStringParameter "$DIR_SPOOL"
- "Directory to setup server spooling area"; DIR_SPOOL="$param"
- ;;
- 7) promptForNonNullStringParameter "$DIR_LOCKS"
- "Directory for uucp lock files"; DIR_LOCKS="$param"
- ;;
- 8) promptForUUCPLockScheme;;
- 9) promptForImagerPackage; PickRIP; CheckRIP;;
- 10) promptForNonNullStringParameter "$PATH_PSRIP"
- "PostScript imager program"; PATH_PSRIP="$param"
- case "$PS" in
- dps) PATH_DPSRIP=$PATH_PSRIP;;
- imp) PATH_IMPRIP=$PATH_PSRIP;;
- gs) PATH_GSRIP=$PATH_PSRIP;;
- esac
- ;;
- 11) promptForManPageScheme;;
- 12) promptForPageSize $SRCDIR/util/pagesizes.in;;
- 13) promptForVRes;;
- 14) promptForNonNullStringParameter "$PATH_GETTY"
- "Location of getty program"; PATH_GETTY="$param"
- ;;
- 15) promptForNonNullStringParameter "$PATH_VGETTY"
- "Location of vgetty program"; PATH_VGETTY="$param"
- ;;
- 16) promptForNonNullStringParameter "$PATH_SENDMAIL"
- "Location of sendmail program"; PATH_SENDMAIL="$param"
- ;;
- 17) promptForNonNullStringParameter "$TIFFBIN"
- "Location of TIFF tools"; TIFFBIN="$param"
- ;;
- 18) promptForNonNullStringParameter "$DIR_SYSVINIT"
- "Location of SysV init scripts"; DIR_SYSVINIT="$param"
- ;;
- 19) promptForNonNullStringParameter "$DIR_SYSVINITSTART"
- "Location of SysV start scripts"; DIR_SYSVINITSTART="$param"
- ;;
- 20) promptForNonNullStringParameter "$DIR_SYSVINITSTOP"
- "Location of SysV stop scripts"; DIR_SYSVINITSTOP="$param"
- ;;
- 21) promptForNonNullStringParameter "$NAME_SYSVINITSTART"
- "Name of SysV start script"; NAME_SYSVINITSTART="$param"
- ;;
- 22) promptForNonNullStringParameter "$NAME_SYSVINITSTOP"
- "Name of SysV stop script"; NAME_SYSVINITSTOP="$param"
- ;;
- 23) promptForNonNullStringParameter "$FAXQ_SERVER"
- "Init script starts faxq"; FAXQ_SERVER="$param"
- ;;
- 24) promptForNonNullStringParameter "$HFAXD_SERVER"
- "Init script starts hfaxd"; HFAXD_SERVER="$param"
- ;;
- 25) promptForNonNullStringParameter "$HFAXD_SNPP_SERVER"
- "Start paging protocol"; HFAXD_SNPP_SERVER="$param"
- ;;
- esac
- }
- checkForExecutable()
- {
- test -x $1 || bitchExecutable $1
- }
- if [ $QUIET = no ] && [ $INTERACTIVE != no ]; then
- Note "Press Return to Continue "
- read ok
- fi
- if [ $QUIET = no ]; then
- ok=skip
- while [ "$ok" != y ] && [ "$ok" != yes ]; do
- if [ "$ok" != skip ]; then
- for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
- promptForParameter $i;
- done
- fi
- printConfig1
- if [ $INTERACTIVE = no ]; then
- ok=yes
- else
- prompt "Are these ok [yes]?"; read ok
- test -z "$ok" && ok=yes
- case "$ok" in
- [1-9]|1[0-4]) 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
- fi
- done
- fi
- if [ $QUIET = no ]; then
- ok=skip
- while [ "$ok" != y ] && [ "$ok" != yes ]; do
- if [ "$ok" != skip ]; then
- for i in 15 16 17 18 19 20 21 22 23 24 25 26 27 ; do
- promptForParameter $i;
- done
- fi
- printConfig2
- checkForExecutable $PATH_SENDMAIL
- checkForExecutable $PATH_GETTY
- if [ $INTERACTIVE = no ]; then
- ok=yes
- else
- prompt "Are these ok [yes]?"; read ok
- test -z "$ok" && ok=yes
- case "$ok" in
- 1[5-9]|2[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
- fi
- done
- fi
- $RM config.cache; dumpvals |sort> config.cache
- case $MANSCHEME in
- bsd-source-*) MANAPPS=man1 MANSYS=man8 MANFILES=man5;;
- bsd-nroff-*) MANAPPS=cat1 MANSYS=cat8 MANFILES=cat5;;
- sysv-source-*) MANAPPS=man1 MANSYS=man1 MANFILES=man4;;
- sysv-nroff-*) MANAPPS=cat1 MANSYS=cat1 MANFILES=cat4;;
- esac
- case $MANSCHEME in
- bsd-*-strip) MANNUM4_5=5 MANNUM1_8=8;;
- bsd-*) MANNUM4_5=5F MANNUM1_8=8C;;
- sysv-*-strip) MANNUM4_5=4 MANNUM1_8=1;;
- sysv-*) MANNUM4_5=4F MANNUM1_8=1M;;
- esac
- case $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 > $@';;
- esac
- case $MANSCHEME in
- *-0|*-0.gz|*-0.Z|*-gz|*-Z|*-z)
- suf=`echo $MANSCHEME | $SED 's/.*-/./'`
- A='`echo $$i | sed' B='`' # workaround shell bugs
- MANCAPPNAME="$A s/\\.1$$/$suf/$B"
- MANCFILENAME="$A s/\\.4f$$/$suf/$B"
- MANSAPPNAME="$A s/\\.1m$$/$suf/$B"
- MANSFILENAME="$A s/\\.4f$$/$suf/$B"
- ;;
- bsd-*-strip)
- MANCAPPNAME='$$i'
- MANCFILENAME='`echo $$i | sed s/\.4f$$/.5/`'
- MANSAPPNAME='`echo $$i | sed s/\.1m$$/.8/`'
- MANSFILENAME='`echo $$i | sed s/\.4f$$/.5/`'
- ;;
- *-strip)
- MANCAPPNAME='$$i'
- MANCFILENAME='`echo $$i | sed s/\.4f$$/.4/`'
- MANSAPPNAME='`echo $$i | sed s/\.1m$$/.1/`'
- MANSFILENAME='`echo $$i | sed s/\.4f$$/.4/`'
- ;;
- bsd-*)
- MANCAPPNAME='$$i'
- MANCFILENAME='`echo $$i | sed s/\.4f$$/.5f/`'
- MANSAPPNAME='`echo $$i | sed s/\.1m$$/.8c/`'
- MANSFILENAME='`echo $$i | sed s/\.4f$$/.5f/`'
- ;;
- *)
- MANCAPPNAME='$$i' MANCFILENAME='$$i'
- MANSAPPNAME='$$i' MANSFILENAME='$$i'
- ;;
- esac
- Note ""
- if [ $GS = yes ]; then
- test -d $SRCDIR/gs || {
- Note ""
- Note "WARNING, no Ghostscript build directory exists; disabling building"
- Note "and installation of Ghostscript from source (GS=no)."
- Note ""
- GS=no
- }
- fi
- if [ $DPS = yes ]; then
- test -d $SRCDIR/dps || {
- Note ""
- Note "WARNING, no DPS build directory exists; disabling building"
- Note "and installation of ps2fax for IRIX (DPS=no)."
- Note ""
- DPS=no
- }
- fi
- if [ $IMP = yes ]; then
- test -d $SRCDIR/imp || {
- Note ""
- Note "WARNING, no Impressario build directory exists; disabling building"
- Note "and installation of the Impressario 2.1 back-end for IRIX (IMP=no)."
- Note ""
- IMP=no
- }
- fi
- #
- # Convert default page size name to an entry that goes
- # in the pagesizes database file.
- #
- F=$SRCDIR/util/pagesizes
- test -f $F.in || {
- bitch "$F.in is missing; this should be part of the distribution."
- boom
- }
- DEFPAGESIZE=`grep "$PAGESIZE" $F.in | $SED -e 's/[^ ]*/default/;q'`
- x="`relativize ${LIBTIFF}`"; LIBTIFF="$x"
- x="`relativize ${LIBZ}`"; LIBZ="$x"
- x="`relativize ${LIBREGEX}`"; LIBREGEX="$x"
- # NB: these should be sorted alphabetically
- $RM confsed1; dumpvars "$VAR1" | sort > confsed1
- $RM confsed2; dumpvars "$VAR2" | sort > confsed2
- SedConfigFiles()
- {
- 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@).
- #
- unset POSIXLY_CORRECT
- $RM $F.new; $SED -f confsed1 $SRCDIR/$F.in | $SED -f confsed2 > $F.new
- POSIXLY_CORRECT=1 ; export POSIXLY_CORRECT
- $RM confx; $SED '/D[aA][tT][eE]:/d' $F.new >confx
- $RM confy; $SED '/D[aA][tT][eE]:/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"
- unset POSIXLY_CORRECT
- if $SED -f confsed1 $SRCDIR/$F.in | $SED -f confsed2 >$F.new; then
- POSIXLY_CORRECT=1 ; export POSIXLY_CORRECT
- $RM $F; $MV $F.new $F; $CHMOD 444 $F
- else
- POSIXLY_CORRECT=1 ; export POSIXLY_CORRECT
- cat 1>&2 <<EOF
- Help, there was a problem crafting $F from $F.in.
- The command:
- $SED -f confsed1 $SRCDIR/$F.in | $SED -f confsed2 >$F.new
- failed. Aborting without cleaning up files so you can take a look...
- EOF
- exit 1 # NB: don't use boom/die
- fi
- fi
- done
- }
- #
- # Configuration File Generation
- #
- # The following files are created using the parameters determined above:
- #
- # defs master make include file for the source code
- # rules make definitions for building from source code
- # config.h master definitions compiled into code
- # */Makefile make rules files
- # port/install.sh SGI install program emulation script
- # port/mkdepend makefile dependency generator (if configured)
- # etc/faxsetup.sh script for setting up a machine
- # etc/faxaddmodem.sh script for adding/configuring a modem
- # etc/probemodem.sh script for probing a modem for its capabilities
- # etc/hylafax SysV-style init script for HylaFAX servers
- # faxcover/edit-faxcover.sh script to edit faxcover.ps
- # util/xferfaxstats.sh script for transmit statistics accounting
- # util/recvstats.sh script for receive statistics accounting
- # util/faxcron.sh script for cleaning up the spooling area (run from cron)
- # util/pagesizes client page dimensions database (has default page size)
- # pkg/cpkginfo SVR4 package stuff (client package info)
- # pkg/cproto.stub SVR4 package stuff (client prototype stub)
- # pkg/crequest SVR4 package stuff
- # pkg/make_proto.sh SVR4 package stuff (script for making prototype files)
- # pkg/postinstall SVR4 package stuff
- # pkg/postremove SVR4 package stuff
- # pkg/spkginfo SVR4 package stuff (server package info)
- # pkg/sproto.stub SVR4 package stuff (server prototype stub)
- # pkg/srequest SVR4 package stuff
- #
- CONF_FILES="
- defs
- config.h
- rules
- Makefile
- config/Makefile
- etc/Makefile
- faxalter/Makefile
- faxcover/Makefile
- faxd/Makefile
- faxmail/Makefile
- faxrm/Makefile
- faxstat/Makefile
- hfaxd/Makefile
- man/Makefile
- sendfax/Makefile
- sendpage/Makefile
- util/Makefile
- faxcover/edit-faxcover.sh
- faxmail/application-pdf.sh
- faxmail/application-octet-stream.sh
- faxmail/image-tiff.sh
- port/Makefile
- port/install.sh
- port/version.c
- etc/faxsetup.sh
- etc/faxsetup.linux
- etc/faxaddmodem.sh
- etc/probemodem.sh
- etc/hylafax
- util/xferfaxstats.sh
- util/recvstats.sh
- util/faxcron.sh
- util/pagesizes
- util/archive.sh
- util/dictionary.sh
- util/common-functions.sh
- util/faxrcvd.sh
- util/mkcover.sh
- util/notify.sh
- util/pcl2fax.sh
- util/pollrcvd.sh
- util/ps2fax.dps.sh
- util/ps2fax.gs.sh
- util/pdf2fax.gs.sh
- util/ps2fax.imp.sh
- util/tiff2fax.sh
- util/wedged.sh
- util/tiff2pdf.sh
- util/qp-encode.awk
- util/rfc2047-encode.awk
- util/dict-de
- util/dict-es
- util/dict-it
- util/dict-pt
- util/dict-ro
- util/dict-tr
- util/dict-en
- util/dict-fr
- util/dict-pl
- util/dict-pt_BR
- util/dict-sr
- util/dict-zh
- pkg/Makefile
- pkg/cpkginfo
- pkg/cproto.stub
- pkg/crequest
- pkg/make_proto.sh
- pkg/postinstall
- pkg/postremove
- pkg/spkginfo
- pkg/sproto.stub
- pkg/srequest
- "
- SedConfigFiles $CONF_FILES
- test $DPS = yes && SedConfigFiles dps/Makefile
- test $GS = yes && SedConfigFiles gs/Makefile
- test $IMP = yes && SedConfigFiles imp/Makefile
- test "$MKDEPEND" != ":" && SedConfigFiles port/mkdepend
- test $SGI2FAX = yes && SedConfigFiles sgi2fax/Makefile
- test $REGEX = yes && SedConfigFiles regex/Makefile
- if [ "$MAKEDEPINCLUDE" != "sinclude" ]; then
- Note "Setting up make dependency files."
- #
- # Setup null make dependency files so that we can include
- # it w/o problem. Some systems have conditional include
- # support in their make, but others do not, so we use an
- # unconditional include and setup everthing as null here
- #
- DEPEND=".
- faxalter
- faxcover
- faxd
- faxmail
- faxrm
- faxstat
- hfaxd
- sendfax
- sendpage
- util
- man
- etc
- config
- "
- test $GS = yes && DEPEND="$DEPEND gs"
- test $SGI2FAX = yes && DEPEND="$DEPEND sgi2fax"
- test $PORT = yes && DEPEND="$DEPEND port"
- test $REGEX = yes && DEPEND="$DEPEND regex"
- test -d $SRCDIR/faxview && test -d faxview && DEPEND="$DEPEND faxview"
- for i in $DEPEND; do
- test -f $i/Makedepend || cp /dev/null $i/Makedepend
- done
- fi
- Note "Done."
- $RM $JUNK
- exit 0