Donate Share

ScummVM

Tracker: Patches

5 Add support for non-gcc compilers to configure, Makefile etc - ID: 2838507
Last Update: Comment added ( canavan )

Currently, configure fails for any compilers that don't support
-dumpversion and adds numerous gcc-only Warning flags even if this check is
circumvented. This patch adds some basic infrastructure to support non-gcc
compilers and adds actual support for one, namely MipsPRO on IRIX.


canavan ( canavan ) - 2009-08-16 12:45

5

Closed

Accepted

Max Horn

None

None

Public


Comments ( 5 )

Date: 2009-09-27 16:05
Sender: canavan

configure seems to be working so far, but there's still one issue i had
forgotten about: With templates, one cannot use ar, but has to use CC
-ptused -ar -o. Since configure sets _ar automatically, with no manual
method to override, one needs seomthing like the patch below:

Index: configure
===================================================================
--- configure (revision 44403)
+++ configure (working copy)
@@ -1218,6 +1218,9 @@
irix*)
DEFINES="$DEFINES -DUNIX -DIRIX
-DSYSTEM_NOT_SUPPORTING_D_TYPE"
LIBS="$LIBS -lmd -lfastm -lm"
+ if test "$have_gcc" != yes; then
+ _ar="$CXX -ptused -quiet_prelink -ar -o"
+ fi
_ranlib=:
;;
darwin*)
@@ -1648,6 +1651,16 @@
add_to_config_mk_if_yes "$_verbose_build" 'VERBOSE_BUILD = 1'

#
+# Check whether AR and/or ARFLAGS is set
+#
+if test -n "$AR"; then
+ _ar="$AR";
+fi
+if test -n "$ARFLAGS"; then
+ _ar="$_ar $ARFLAGS";
+fi
+
+#
# Check whether plugin support is requested and possible
#
echo_n "Checking whether building plugins was requested... "



Date: 2009-09-25 12:11
Sender: fingolfinSourceForge.net Subscriber and DonorProject AdminAccepting Donations

I committed a modified version of this patch. It would be good if you could
test it on your system to see if it still works there.

Thanks!


Date: 2009-09-24 09:44
Sender: fingolfinSourceForge.net Subscriber and DonorProject AdminAccepting Donations

SF.net ate your comment? Man, I fully sympathize, it's kind of refreshing
to hear that I am not the only one it happens to (luckily, it's far less
bad these days then it used to be a couple months ago). Really really
annoying :(.


Regarding CXX_UPDATE_DEP_FLAG -- looking at the Sun C++ docs, it seems
that its -xMMD option mirrors the -MMD option of GCC, so that looks as if
it could be used to also provide an intelligent build rule.

But what I find more convincing now that I looked at the patch once more
is that the GCC3 rule could also be modified to use CXX_UPDATE_DEP_FLAG.

The Sun C++ (and maybe also the MipsPRO?) build rule would still be dumber
than the GCC3 one, esp. since there seems to be no equivalent of -MP, but
well, so be it.



Date: 2009-09-23 23:20
Sender: canavan

Now that sourceforge has eaten my carefully crafted comment, a shorter
version will ahve to do.

7.4.4 is most likely the only wokring version of the MipsPRO C++ compiler,
since it fixes a bunch of tempolate handling bugs that outright prevent
older versions (at least 7.4.1) from compiling scummvm. I assume that
there is at least a 99% probablility that a non-gcc compiler on IRIX is
MipsPRO, but it would be trivial to add another check for that.

-lm and -lfastm are the math libraries that contain trigonometric,
exp/log, rounding etc. routines, libfastm just has some less precise but
faster versions. gcc links libm automatically when needed, CC doesn't and
requires at least -lm to be added to scummvm's link command.

I believe a generic flag is a better option, since the branch in the
Makeifle can be recycled for other compilers. I think SUN's C++ compiler
should be able to use the same feature by just substituting -xM for
-MDupdate.


Date: 2009-09-23 17:54
Sender: fingolfinSourceForge.net Subscriber and DonorProject AdminAccepting Donations

Hi there, first off, thanks for your patch!
Adding support for other compilers seems like a good idea, in principle.
In particular, it's a good idea to add an HAVE_GCC flag.

However, I am a bit wary of the way this is done here. Essentially, the
patch assumes that if a non-GCC compiler is found on IRIX, then it is
MipsPRO. Well, actually, not quite true: It also requires the version of
that compiler to be 7.4.4*, else it'll bail out, too.


Also, this patch does more than advertised: It sets some special flags on
IRIX:

- LIBS="$LIBS -lmd "
+ LIBS="$LIBS -lmd -lfastm -lm"
+ if test "$HAVE_GCC" -ne 1 ; then
+ add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MDupdate'
+ fi

I have to wonder, what do -lfastm and -lm do? Are those compatible with
GCC?

Finally, a new variable "CXX_UPDATE_DEP_FLAG" is introduced, which seems
to be there to take advantage of a MIPSPro feature, yet the name sounds as
if it was something generic. To me it would seem to make more sense to have
a HAVE_MIPSPRO flag for that. Or at least a
HAVE_MIPSPRO_UPDATE_DEP_OPTION.




Attached File ( 1 )

Filename Description Download
configure-non-gcc-compilers.patch Download

Changes ( 5 )

Field Old Value Date By
status_id Open 2009-09-25 12:11 fingolfin
resolution_id None 2009-09-25 12:11 fingolfin
assigned_to nobody 2009-09-25 12:11 fingolfin
close_date - 2009-09-25 12:11 fingolfin
File Added 339369: configure-non-gcc-compilers.patch 2009-08-16 12:45 canavan