home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / fchk294s.zip / ftnchek-2.9.4 / configure.in < prev    next >
Text File  |  1996-10-02  |  6KB  |  251 lines

  1. dnl configure.in   Process with autoconf to produce a configure script.
  2. dnl  This autoconf input file is for ftnchek version 2.9, April 1996
  3. dnl  Acknowledgement and thanks to Judah Milgram for help producing this file.
  4.  
  5. AC_INIT(ftnchek.c)
  6.  
  7. AC_CANONICAL_HOST
  8.  
  9. dnl Look for yacc or bison. If bison, then -y used, so don't need
  10. dnl to worry about YSTEM. (but what if it finds byacc?)
  11.  
  12. AC_PROG_YACC
  13. if test -z "$YACC"; then  
  14.    AC_MSG_WARN([Didn't find yacc or bison])
  15. fi
  16.  
  17. dnl Look for mawk/nawk/awk:
  18.  
  19. AC_PROG_AWK
  20. if test $AWK = awk; then
  21.    case $host_os in
  22.    aix*)
  23.       AC_MSG_WARN([This awk might not work in dcl2inc. Need gawk or nawk]) ;;
  24.    esac
  25. fi
  26.  
  27. dnl Check for gcc/cc
  28.  
  29. AC_PROG_CC
  30.  
  31. dnl Check for floating point option (really on applies to Suns, I
  32. dnl think, and probably only Solaris at that).
  33.  
  34. AC_CHECK_PROGS(FPVERSION,fpversion)
  35. if test "$FPVERSION" ; then
  36.   AC_MSG_CHECKING([for a floating point option])
  37.   CG_FLAG=`$FPVERSION -foption`
  38.   if test "CG_FLAG"; then CG_FLAG=-$CG_FLAG; fi
  39.   AC_MSG_RESULT([ $CG_FLAG ])
  40. fi
  41.  
  42. dnl Check for nroff
  43.  
  44. AC_CHECK_PROGS(NROFF,nroff)
  45. if test -n "$NROFF" ; then
  46.     HAS_NROFF='true'
  47. else
  48.   AC_CHECK_PROGS(NROFF,groff)
  49. if test -n "$NROFF" ; then
  50.     HAS_NROFF='true'
  51.   else
  52.     HAS_NROFF='false'
  53.     NROFF='false'
  54.   fi
  55. fi
  56.  
  57. dnl Look for man-to-ps filter.  Take groff if present but settle for others.
  58.  
  59. AC_CHECK_PROGS(TROFF,groff)
  60. if test -n "$TROFF" ; then
  61.     MANtoPS="$TROFF -man"
  62. else
  63.   AC_CHECK_PROGS(TROFF,psroff)
  64.   if test -n "$TROFF" ; then
  65.     MANtoPS="$TROFF -t -man"
  66.   else
  67. dnl        Solaris 2.1
  68.     if test -f /usr/lib/lp/postscript/dpost ; then
  69.        MANtoPS='troff -man | /usr/lib/lp/postscript/dpost'
  70.     else
  71. dnl        Nothing found: say groff and let them figure it out.
  72.        MANtoPS='groff -man'
  73.     fi
  74.   fi
  75. fi
  76.  
  77. dnl Look for strip.  If not, use a harmless substitute
  78.  
  79. AC_CHECK_PROGS(STRIP,strip,[echo >/dev/null])
  80.  
  81.  
  82. dnl See if col is on the path.  If not, it may be BSD-like and user may
  83. dnl not have /usr/5bin on path.
  84.  
  85. AC_CHECK_PROGS(COL,col)
  86. if test -n "$COL" ; then
  87.    COL="$COL -bx"
  88. else
  89.    AC_MSG_CHECKING([for /usr/5bin/col])
  90.    if test -f /usr/5bin/col ; then
  91.       AC_MSG_RESULT([found it])
  92.       COL='/usr/5bin/col -bx'
  93.    else
  94.       AC_MSG_RESULT([col not found -- using cat instead])
  95.       COL=cat
  96.    fi
  97. fi
  98.  
  99.  
  100.  
  101. dnl The following system utilities should be standard on all UNIX systems.
  102. dnl If they are not found on standard path, they are left pathless.
  103.  
  104. STDPATH=/bin:/usr/bin:/usr/ucb:/usr/5bin
  105.  
  106. AC_PATH_PROG(CHMOD,chmod,chmod,$STDPATH)
  107. AC_PATH_PROG(CMP,cmp,cmp,$STDPATH)
  108. AC_PATH_PROG(CP,cp,cp,$STDPATH)
  109. AC_PATH_PROG(DIFF,diff,diff,$STDPATH)
  110. AC_PATH_PROG(EQN,eqn,eqn,$STDPATH)
  111. AC_PATH_PROG(MKDIR,mkdir,mkdir,$STDPATH)
  112. AC_PATH_PROG(MV,mv,mv,$STDPATH)
  113. AC_PATH_PROG(PWD_PROG,pwd,pwd,$STDPATH)
  114. AC_PATH_PROG(RM,rm,rm,$STDPATH)
  115. AC_PATH_PROG(RMDIR,rmdir,rmdir,$STDPATH)
  116. AC_PATH_PROG(SED,sed,sed,$STDPATH)
  117. AC_PATH_PROG(SH,sh,sh,$STDPATH)
  118. AC_PATH_PROG(SOELIM,soelim,soelim,$STDPATH)
  119. AC_PATH_PROG(TAR,tar,tar,$STDPATH)
  120. AC_PATH_PROG(TBL,tbl,tbl,$STDPATH)
  121.  
  122. dnl  Add the necessary flag to RM.
  123. RM="$RM -f"
  124.  
  125. dnl Set compiler options depending on operating system:
  126.  
  127. dnl Here's the place to tweak compiler settings, not in 
  128. dnl Makefile.in, (and certainly not in Makefile!)
  129.  
  130.  
  131. INSTALL_MAN='install-man'
  132. case $host_os in
  133.   aix*)
  134.     if test -z "$GCC"; then
  135.       if test "$CC" = cc ; then
  136.         CC=c89
  137.       fi
  138.       OS_FLAGS="-DAIXC -D_BSD -O"
  139.     else
  140.         OS_FLAGS="-O2"
  141.     fi;;
  142.   hpux*)
  143.     if test -z "$GCC"; then
  144.       if test "$CC" = cc ; then
  145.         CC=c89
  146.       fi
  147.       OS_FLAGS=" +O2 +Onolimit"
  148.     else
  149.       OS_FLAGS="-O2"
  150.     fi;;
  151.   irix*)
  152.     OS_FLAGS="-O2"
  153.     INSTALL_MAN='install-man-sgi';;
  154.   linux*)
  155. changequote(<<, >>)dnl
  156.     if echo $host_cpu | grep 'i[^3]86' >/dev/null 2>&1 ; then
  157.       OS_FLAGS="-O2 -m486";
  158.     else
  159.       OS_FLAGS="-O2";
  160.     fi;;
  161. changequote([, ])dnl
  162.   next*)
  163.     OS_FLAGS="-O2";;
  164.   osf*) 
  165.     if test -z "$GCC"; then 
  166.       OS_FLAGS="-ieee_with_inexact -O -Olimit 1000"
  167.     else
  168.        OS_FLAGS="-O2"
  169.     fi;;
  170.   sunos*)
  171.     OS_FLAGS="-O2";;
  172.   solaris*)
  173.     cpucc="$host_cpu"-"$CC"
  174.     case $cpucc in
  175.        sparc-cc) OS_FLAGS="-Xc -xO4 $CG_FLAG";;
  176.        *gcc) OS_FLAGS="-O2";;
  177.        *cc)  OS_FLAGS="-O";; 
  178.     esac;;
  179.   ultrix*)
  180.     if test -z "$GCC"; then
  181.       OS_FLAGS="-O2 -Olimit 1000"
  182.     else
  183.       OS_FLAGS="-O2"
  184.     fi;;
  185.   *)
  186.     AC_MSG_WARN([Operating system not determined. Using generic flags.])
  187.     OS_FLAGS="-O";;
  188. esac
  189.  
  190. AC_MSG_CHECKING([whether $CC accepts function prototypes])
  191. dnl the test prog includes specific code that chokes some compilers
  192. AC_CACHE_VAL(ac_cv_prog_CC_protos,[
  193. AC_TRY_COMPILE([],
  194.   [extern int foo(int arg); /* basic prototype */
  195.    static int (*ii_fun[]) ( int *args )={ 0, };],
  196.   ac_cv_prog_CC_protos=yes,ac_cv_prog_CC_protos=no)])
  197. AC_MSG_RESULT([$ac_cv_prog_CC_protos])
  198. if test $ac_cv_prog_CC_protos = yes ; then
  199.    PROTOFLAG=""
  200. else
  201.    PROTOFLAG="-DNO_PROTOTYPES"
  202. fi
  203.  
  204. CFLAGS="-DUNIX -DLARGE_MACHINE $OS_FLAGS $PROTOFLAG"
  205. AC_MSG_RESULT([Compile command is $CC $CFLAGS])
  206. if test $GCC; then
  207. AC_MSG_RESULT([If you prefer using cc, setenv CC cc; rm config.cache and re-run])
  208. fi
  209.  
  210. dnl Define LDFLAGS here just so configure_os2.cmd can easily use the
  211. dnl same Makefile.in as we do.
  212. LDFLAGS=
  213.  
  214. dnl Here we define EXE and CMD prefixes to be null, as needed by Unix.
  215. dnl Do this way just so they can be substituted otherwise for OS/2 et al.
  216.  
  217. EXE=
  218. CMD=
  219. AC_SUBST(EXE)
  220. AC_SUBST(CMD)
  221.  
  222. AC_SUBST(YACC)
  223. AC_SUBST(AWK)
  224. AC_SUBST(NROFF)
  225. AC_SUBST(MANtoPS)
  226. AC_SUBST(STRIP)
  227. AC_SUBST(COL)
  228. AC_SUBST(SED)
  229. AC_SUBST(CC)
  230. AC_SUBST(CFLAGS)
  231. AC_SUBST(LDFLAGS)
  232. AC_SUBST(INSTALL_MAN)
  233. AC_SUBST(HAS_NROFF)
  234.  
  235. AC_SUBST(CHMOD)
  236. AC_SUBST(CMP)
  237. AC_SUBST(CP)
  238. AC_SUBST(DIFF)
  239. AC_SUBST(EQN)
  240. AC_SUBST(MKDIR)
  241. AC_SUBST(MV)
  242. AC_SUBST(PWD_PROG)
  243. AC_SUBST(RM)
  244. AC_SUBST(RMDIR)
  245. AC_SUBST(SHELL)
  246. AC_SUBST(SOELIM)
  247. AC_SUBST(TBL)
  248. AC_SUBST(TAR)
  249. AC_OUTPUT( Makefile dcl2inc test/Makefile test/Compare.sh )
  250. chmod +x dcl2inc test/Compare.sh
  251.