no way to conditionally check for a C compiler?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My problem: I use autoconf+automake for Kawa.  (There is an option
to build using Ant, but it doesn't support running all the tests,
for example.)  Most of Kawa is written in Java, but there is a
--enable-kawa-frontend option that builds a small C front-end wrapper
that uses readline.

This means I have to do AC_PROG_CC unconditionally, which means
you can't run configure unless a C compiler is available.  This is
a shame, since you only need the C compiler if --enable-kawa-frontend
is selected.

I realize this is a highly unusual use-case, and autoconf can't
necessarily be all things to everyone.  I thought I'd just ask if
there is a recommended solution.

I tried:

AC_CHECK_PROG(CC, gcc cc, missing-c-compiler)
AC_SUBST(CC)

But then automake complains:

/usr/share/automake-1.13/am/depend2.am: error: am__fastdepCC does not appear in AM_CONDITIONAL /usr/share/automake-1.13/am/depend2.am: The usual way to define 'am__fastdepCC' is to add 'AC_PROG_CC' /usr/share/automake-1.13/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again

I kludged this by adding:

AM_CONDITIONAL(AMDEP,false) dnl kludge
AM_CONDITIONAL(am__fastdepCC,false) dnl kludge

But then AC_OBJEXT is ignored.

So it all seems to be tied together: I can use autoconf+automake
as designed to compile C/C++ porgrams - but *only* if I do so
unconditionally.  Otherwise I need to roll my own.

The advice "never perform tests conditionally: depend conditionally
on their output!" doesn't apply when the tests conditionally abort ...
--
	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux