Discussion:
Standard AC macro calls
Erickson, David
2013-12-24 00:14:05 UTC
Permalink
I'm curious why the macros

AC_CONFIG_SUBDIRS
and
AC_SUBST

take differing arguments to work?

In this snippet

# find all subdirectories that will have source code and therefore libraries.
# add the subdirs for configuration and the libary to the superlibrary
for FILE in `ls -d */`
do
case "$FILE" in
autom4te* ) continue ;; #
m4*) continue ;; #
* )
SRC_SUBDIRS+=" $FILE"
LIB_LIBSRC+="lib${FILE:0:-1}.la "
esac
done
AC_CONFIG_SUBDIRS([${SRC_SUBDIRS}])
AC_SUBST(SRC_SUBDIRS)

I could get them both to work but only in these differing ways. Trust me, I tried them all.

Can someone please explain - succinctly - why this is so?

Thanks,
Dave

D.R. Erickson
Defence Research and Development Canada Suffield | Recherche et développement pour la défense Canada Suffield
Medicine Hat, AB, Canada T1A 8K6
***@drdc-rddc.gc.ca
Telephone |Téléphone 403-544-4048 / Facsimile | Télécopieur 403-544-4701
Government of Canada | Gouvernement du Canada
Carsten Heinrici
2013-12-24 01:16:28 UTC
Permalink
Hi David
Post by Erickson, David
I'm curious why the macros
AC_CONFIG_SUBDIRS
and
AC_SUBST
take differing arguments to work?
Because the arguments are of different type: AC_CONFIG_SUBDIRS gets a
literal string which resolves to a list of paths, while AC_SUBST gets
the name of an output variable name (@xxx@) to substitute with value
of a shell variable of the same name when configure is run.
Post by Erickson, David
AC_CONFIG_SUBDIRS([${SRC_SUBDIRS}])
Using variables is not recommended since it prevents `./configure
--help=recursive' from working correctly.
See http://www.gnu.org/software/autoconf/manual/autoconf-2.62/html_node/Subdirectories.html

Best regards
Carsten

Loading...