[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Help with M4 and autoconf
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Help with M4 and autoconf |
Date: |
Sun, 6 May 2012 14:42:48 -0400 |
I'm revision at 14598:0d37fda09415, and I think the amount of repeated
code starting in configure.ac:2269 is kinda silly. I want to fix this.
So I wrote something like this:
dnl
dnl
dnl OCTAVE_WARN_ABOUT_PROBLEMS(LIST-OF-PROBLEMS)
dnl
AC_DEFUN([OCTAVE_WARN_ABOUT_PROBLEMS], [
m4_foreach([problem_found], [m4_set_list([$1])], [
if test -n "$problem_found"; then
AC_MSG_WARN([$problem_found])
warn_msg_printed=true
fi])
])
So now it's just a matter of populating the list, using m4_set_add, if
I am reading the autoconf manual correctly, which can be done with
something like
m4_set_add([list_of_problems], [warn_$1])
Now, a lot of those warn_foo variables (macros?) are set in
m4/acinclude.m4:448, in the OCTAVE_CHECK_LIBRARY function (macro?),
some are set in various parts of configure.ac, and some I have no idea
where they are set (e.g. warn_fftw). Is this a bug? Is warn_fftw just
never set?
I'm floundering here. I don't really understand how to use M4. Can
someone give me some hints?
The reason I started doing all this is that I noticed that ARPACK
doesn't produce a clear warning at the end of ./configure if it's
missing, so I'm trying to fix this the "right" way, by eliminating
duplicate code and automating warnings about missing libraries a bit
more.
TIA,
- Jordi G. H.
- Help with M4 and autoconf,
Jordi Gutiérrez Hermoso <=