[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to test compiler and create messaged based on version of gcc?
From: |
Philip Herron |
Subject: |
Re: How to test compiler and create messaged based on version of gcc? |
Date: |
Thu, 06 Aug 2009 01:33:52 +0100 |
User-agent: |
Thunderbird 2.0.0.22 (X11/20090608) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi
Its a shame you haven't had success on building with other compilers
you say about gcc 4.0.0 being too buggy, you mean the compiler or your
program comes out buggy? If thats the case your definitely going to
need to look at your sources in my opinion gcc is a very nice compiler
making very safe code. And other compilers may not be so nice.
For a configure.ac you could write something like:
AC_PREREQ(2.59)
AC_INIT(<name>, <version>, <bug-report>)
AC_CONFIG_SRCDIR([...])
AC_CONFIG_HEADER([...])
#if you want to use more macros
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CC_C99
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT
That would be a basic outline of a configure.ac but not that usefull.
I put in AC_PROG_CC_C99 as it useful and i only found it recently and
auto puts -std=gnu99 on your gcc line anyways.
you could add in the check:
if test x$CC = xgcc ; then
#this is very likely to fail and is a bad way to do it :S
#VERSION=`gcc --version | grep gcc | awk {'print $4'}`
#so using that macro should do the trick chuck that macro
#into the m4 dir mentioned at the top and do
VERSION=AX_GCC_VERSION
#Not too sure if you can do less than or gt on that but you could
give it ago :)
elif
AC_MSG_ERROR(not gcc)
fi
But if your seriously want to do this i would make sure you can
compile your code with gcc 4 at least before considering trying with
sun-studio it took me a good while to get used to using them.
Anyways good luck sage is pretty powerful :)
- --Phil
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkp6JN8ACgkQAhcOgIaQQ2GgOACfXZZaktL8zg8te8O9p9FnqMXW
eXoAn2386Oq5JzLXN+r1nbk6orMIsO0q
=nOHP
-----END PGP SIGNATURE-----