X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=configure.in;h=735fafb17de753f7a845c228645c590eb612850f;hb=01bf3c4476a755272bdb7fb4c1f57429524a8135;hp=aa174afa024c00e8db918a6aa80a3bbc422108e9;hpb=76f5c1f588c9d887958d74fb7aa7b5832ee41a67;p=fw%2Fsdcc diff --git a/configure.in b/configure.in old mode 100755 new mode 100644 index aa174afa..735fafb1 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ #!/bin/sh -AC_PREREQ(2.54) -AC_INIT +AC_PREREQ(2.60) +AC_INIT(.version) AC_CONFIG_SRCDIR([Makefile.in]) AC_CONFIG_HEADER(sdccconf.h:sdccconf_in.h) @@ -9,11 +9,14 @@ AC_PROG_AWK AC_MSG_CHECKING(version of the package) if test -f ${srcdir}/.version; then - VERSION=`cat ${srcdir}/.version` + { read VERSION; } < ${srcdir}/.version + AC_MSG_RESULT($VERSION) elif test -f ../.version; then - VERSION=`cat ../.version` + { read VERSION; } < ../.version + AC_MSG_RESULT($VERSION) else VERSION="0.0.0" + AC_MSG_RESULT(unknown using 0.0.0) fi VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'` VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'` @@ -41,13 +44,18 @@ AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_RANLIB -AC_PROG_LEX -AC_PROG_YACC AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, :) AC_CHECK_PROG(STRIP, strip, strip, :) AC_CHECK_PROG(AS, as, as, :) AC_CHECK_PROG(CP, cp, cp, :) +dnl Don't use AC_PROG_LEX +dnl LEXLIB is not useful in gcc. +AC_CHECK_PROGS(LEX, flex lex, :) + +dnl Don't use AC_PROG_YACC +AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :) + AC_DEFUN(SDCC_REQUIRE_PROG, [if test "$1" = ":"; then AC_MSG_ERROR([Cannot find required program $2.]) @@ -55,7 +63,7 @@ AC_DEFUN(SDCC_REQUIRE_PROG, ]) SDCC_REQUIRE_PROG($YACC, bison) -SDCC_REQUIRE_PROG($LEX, lex) +SDCC_REQUIRE_PROG($LEX, flex) AC_LANG_C @@ -378,7 +386,78 @@ AC_DEFINE_UNQUOTED(TYPE_UBYTE, unsigned $TYPE_CHAR) AC_DEFINE_UNQUOTED(TYPE_UWORD, unsigned $TYPE_WORD) AC_DEFINE_UNQUOTED(TYPE_UDWORD, unsigned $TYPE_DWORD) -AC_C_BIGENDIAN + +# SDCC_BUILD_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) +# ------------------------------------------------------------------------- +AC_DEFUN([SDCC_BUILD_BIGENDIAN], +[AC_CACHE_CHECK(whether host machine byte ordering is bigendian, sdcc_cv_build_bigendian, +[# See if sys/param.h defines the BYTE_ORDER macro. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include +#include +], +[#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) + bogus endian macros +#endif +])], +[# It does; now see whether it defined to BIG_ENDIAN or not. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include +#include +], [#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +])], [sdcc_cv_build_bigendian=yes], [sdcc_cv_build_bigendian=no])], +[# It does not; compile a test program. +AC_RUN_IFELSE( +[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; +]])], + [sdcc_cv_build_bigendian=no], + [sdcc_cv_build_bigendian=yes], +[# try to guess the endianness by grepping values into an object file + sdcc_cv_build_bigendian=unknown + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }]], +[[ _ascii (); _ebcdic (); ]])], +[if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + sdcc_cv_build_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$sdcc_cv_build_bigendian" = unknown; then + sdcc_cv_build_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + sdcc_cv_build_bigendian=unknown + fi +fi])])])]) +case $sdcc_cv_build_bigendian in + yes) + m4_default([$1], + [AC_DEFINE([BUILD_WORDS_BIGENDIAN], 1, + [Define to 1 if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX).])]) ;; + no) + $2 ;; + *) + m4_default([$3], + [AC_MSG_ERROR([unknown endianness +presetting sdcc_cv_build_bigendian=no (or yes) will help])]) ;; +esac +])# SDCC_BUILD_BIGENDIAN + +SDCC_BUILD_BIGENDIAN # Set standard installation paths # =========================================================================== @@ -725,6 +804,7 @@ sdcc ${VERSION} is now configured for ds400 ${enable_ds400_port} gbz80 ${enable_gbz80_port} hc08 ${enable_hc08_port} + mcs51 ${enable_mcs51_port} pic ${enable_pic_port} pic16 ${enable_pic16_port} xa51 ${enable_xa51_port} @@ -746,6 +826,7 @@ sdcc ${VERSION} is now configured for prefix: ${prefix} datadir: ${datadir} + datarootdir: ${datarootdir} Search paths (incomplete, see manual for all search paths): binary files: \$SDCC_HOME${binPath}