Re: Using --enable-debug and defining a macro from it...?

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

 



Matthew Woehlke <mw_triad@xxxxxxxxxxxxxxxxxxxxx> writes:

> (If this isn't the place for 'how do I...?' questions, please
> re-direct me, but I do see it isn't the -bugs list.)
>
> First off, I have a very skeleton configure.in (see below). How do I
> add '--enable-debug' to this? (I see AC_ARG_ENABLE, but is there not a
> standard one for debug? I can't find one, but it seems to be a
> standard.)
>

Here's one way. Any comments welcome:

# Does the user want to run tests for large files (> 2GiB)?
AC_MSG_CHECKING([whether large file (> 2GB) tests should be run])
AC_ARG_ENABLE([large-file-tests],
              [AS_HELP_STRING([--enable-large-file-tests],
                              [Run tests which create very large data files (~13 GB disk space
			      required, but it will be recovered when tests are complete). See
			      option --with-large-file to specify temporary directory])])
test "x$enable_large_file_tests" = xyes || enable_large_file_tests=no
AC_MSG_RESULT($enable_large_file_tests)
AM_CONDITIONAL(LARGE_FILE_TESTS, [test x$enable_large_file_tests = xyes])

This uses AM_CONDITIONAL (because I need to know the answer in my
Makefile, not my C code.) To get the answer in config.h, use
AC_DEFINE to define something.

Good luck!

Ed

-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://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