File:  [gforth] / gforth / configure.in
Revision 1.14: download - view: text, annotated - select for diffs
Wed Nov 29 20:20:33 1995 UTC (23 years, 11 months ago) by anton
Branches: MAIN
CVS tags: HEAD
replced tester.fs and coretest.fs with the new versions from John Hayes
make mostlyclean virtualclean added
Cache-flushing now works on the Alpha (other minor changes there)
configure now uses gcc by default and passes its GCC variable to the Makefile
introduced sourcefilename and sourceline# (and used them in many places).

    1: dnl Process this file with autoconf to produce a configure script.
    2: 
    3: AC_INIT(engine.c)
    4: 
    5: GCC=${GCC-gcc}
    6: AC_SUBST(GCC)
    7: 
    8: dnl configure needs $CC to find out some parameters, and there may be
    9: dnl differences in what is obtained from gcc and from the default cc.
   10: dnl Therefore, we define $CC to be gcc:
   11: CC=$GCC
   12: 
   13: AC_ARG_ENABLE(force-reg,
   14: [  --enable-force-reg	  Use explicit register declarations if they appear in
   15: 			  the machine.h file. This can cause a good speedup,
   16: 			  but also incorrect code with some gcc versions on
   17: 			  some processors (default disabled).],
   18: 
   19: AC_DEFINE(FORCE_REG))
   20: dnl this is not quite according to the autoconf manual, it causes a replacement
   21: AC_ARG_ENABLE(direct-threaded,
   22: [  --enable-direct-threaded	Force direct threading. This may not work on
   23: 				some machines and may cause slowdown on others.
   24: 				(default processor-dependent)],
   25: AC_DEFINE(DIRECT_THREADED))
   26: AC_ARG_ENABLE(indirect-threaded,
   27: [  --enable-indirect-threaded	Force indirect threading. This can cause a
   28: 				slowdown on some machines.
   29: 				(default processor-dependent)],
   30: AC_DEFINE(INDIRECT_THREADED))
   31: 
   32: AC_ARG_WITH(debug,
   33: [  --with-debug     specifies option -g to compile with debug info (default)
   34:    --without-debug  omits the -g switch and creates smaller images on
   35:                     machines where "strip" has problems with gcc style
   36:                     debugging informations.],
   37: if test "$withval" = "yes"; then DEBUGFLAG=-g; fi)
   38: 
   39: 
   40: AC_SUBST(GCCLDFLAGS)
   41: AC_SUBST(DEBUGFLAG)
   42: 
   43: dnl the following macro produces a warning with autoconf-2.1
   44: AC_CHECK_SIZEOF(char *)
   45: case "$ac_cv_sizeof_char_p" in
   46:   2)
   47:     wordsize=16
   48:     ;;
   49:   4)
   50:     wordsize=32
   51:     ;;
   52:   8)
   53:     wordsize=64
   54: dnl    AC_CHECK_SIZEOF(long long)
   55: dnl    if [ $ac_cv_sizeof_long_long != 16 ]
   56: dnl    then
   57: dnl       try the whole thing with -mlonlong128
   58: dnl complain about C compiler and OS vendor
   59: dnl    fi
   60:     ;;
   61: esac
   62: 
   63: #terminology is a bit unusual here: The host is the system on which
   64: #gforth will run; the system on which configure will run is the `build'
   65: AC_CANONICAL_HOST
   66: case "$host_cpu" in
   67: 	hppa*)
   68: 		mach_h=hppa
   69: 		LIBOBJS="cache.o"
   70: 		LDFLAGS="-Xlinker -N"
   71: 		LIBS="-L/lib/pa1.1/"
   72: 		;;
   73: 	sparc*)
   74: 		mach_h=sparc
   75: 		;;
   76: 	i386|i486|i586)
   77: 		mach_h=386
   78: 		CFLAGS="-fforce-mem -fforce-addr -fomit-frame-pointer"
   79: 		#!! direct/indirect threading switch
   80: 		#!! -m486 flag
   81: 		;;
   82: 	m68*)
   83: 		mach_h=m68k
   84: 		;;
   85: 	mips*)
   86: 		mach_h=mips
   87: 		#link text and data segment into the same 256M region!
   88: 		GCCLDFLAGS="-Xlinker -T -Xlinker 10000000 -Xlinker -D -Xlinker 10400000"
   89: 		;;
   90: 	alpha*)
   91: 		mach_h=alpha
   92: 		echo Very Preliminary Support for Alpha!!!
   93: 		;;
   94: 	*)
   95: 		echo "No direct threading support for $host_cpu, using indirect threading."
   96: 		echo "Using a generic 32-bit machine description. It will only work if char * AND"
   97: 		echo "long values have 32 bits."
   98: 		echo "I'll assume that C floats and doubles are represented by IEEE single and"
   99: 		echo "double numbers. If this is not so, SF@ etc. will not work correctly."
  100: 		mach_h=32bit
  101: esac
  102: AC_SUBST(host)
  103: 
  104: dnl Now a little support for DOS/DJGCC
  105: AC_SUBST(MAKE_EXE)
  106: MAKE_EXE=""
  107: 
  108: dnl copy commands for systems that don't have links
  109: AC_SUBST(LINK_KERNL16L)
  110: LINK_KERNL16L=""
  111: AC_SUBST(LINK_KERNL16B)
  112: LINK_KERNL16B=""
  113: AC_SUBST(LINK_KERNL32L)
  114: LINK_KERNL32L=""
  115: AC_SUBST(LINK_KERNL32B)
  116: LINK_KERNL32B=""
  117: AC_SUBST(LINK_KERNL64L)
  118: LINK_KERNL64L=""
  119: AC_SUBST(LINK_KERNL64B)
  120: LINK_KERNL64B=""
  121: 
  122: #if test $host_os=dos
  123: #then
  124: #  echo Configuring for DOS!!!
  125: #  MAKE_EXE="coff2exe gforth"
  126: #  LINK_KERNL32L='$(CP) kernl32l.fi kernal.fi'
  127: #fi
  128: 
  129: dnl the following macro produces a warning with autoconf-2.1
  130: AC_C_BIGENDIAN
  131: AC_SUBST(KERNAL)
  132: dnl ac_cv_c_bigendian is an undocumented variable of autoconf-2.1
  133: if test $ac_cv_c_bigendian = yes; then
  134:   bytesex=b
  135:   KERNAL="kernl16b.fi kernl16l.fi kernl32b.fi kernl32l.fi kernl64b.fi kernl64l.fi"
  136: else
  137:   bytesex=l
  138:   KERNAL="kernl16l.fi kernl16b.fi kernl32l.fi kernl32b.fi kernl64l.fi kernl64b.fi"
  139: fi
  140: 
  141: dnl Checks for programs.
  142: AC_PROG_LN_S
  143: AC_PROG_INSTALL
  144: 
  145: dnl Checks for library functions
  146: dnl This check is just for making later checks link with libm.
  147: dnl using sin here is no good idea since it is built-into gcc and typechecked
  148: AC_CHECK_LIB(m,asin)
  149: AC_FUNC_MEMCMP
  150: AC_REPLACE_FUNCS(memmove strtoul pow10 strerror strsignal)
  151: AC_CHECK_FUNC(getopt_long,getopt_long="",getopt_long="getopt.o getopt1.o")
  152: AC_SUBST(getopt_long)
  153: AC_CHECK_FUNCS(rint expm1 log1p)
  154: AC_REPLACE_FUNCS(ecvt)
  155: dnl No check for select, because our replacement is no good under
  156: dnl anything but DOS
  157: 
  158: kernal_fi=kernl${wordsize}${bytesex}.fi
  159: AC_SUBST(kernal_fi)
  160: 
  161: AC_LINK_FILES(${mach_h}.h $kernal_fi,machine.h kernal.fi)
  162: AC_OUTPUT(Makefile)
  163: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>