Skip to content

Commit

Permalink
build: fool autoreconf to do a recursive reconfiguration
Browse files Browse the repository at this point in the history
We just redefine AC_CONFIG_SUBDIRS to our own empty version. autoreconf
will see this during the tracing step and will automatically reconfigure
libevent and libnl as well. This may unbreak people relying on tool
trying to regen configure without using the "autogen.sh" script.

Fix #133 (with a bit of luck)
  • Loading branch information
vincentbernat committed Sep 16, 2015
1 parent fcab309 commit b41cea3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 4 additions & 9 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,14 @@ EOF
}


SUBDIRS=""
for dir in *; do
[ -d "$dir" ] || continue
[ -f "$dir"/configure.ac ] || [ -f "$dir"/configure.in ] || continue
SUBDIRS="$SUBDIRS $dir"
done

echo "autogen.sh: start libtoolize to get ltmain.sh"
${LIBTOOLIZE} --copy --force
echo "autogen.sh: reconfigure with autoreconf"
${AUTORECONF} -vif --no-recursive -I m4 . $SUBDIRS || {
${AUTORECONF} -vif -I m4 || {
echo "autogen.sh: autoreconf has failed ($?), let's do it manually"
for dir in $PWD $SUBDIRS; do
for dir in $PWD *; do
[ -d "$dir" ] || continue
[ -f "$dir"/configure.ac ] || [ -f "$dir"/configure.in ] || continue
echo "autogen.sh: configure `basename $dir`"
(cd "$dir" && ${ACLOCAL} -I m4 ${ACLOCAL_FLAGS})
(cd "$dir" && check_pkg_config)
Expand Down
4 changes: 4 additions & 0 deletions m4/config_subdirs.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# to call that late enough.

AC_DEFUN([lldp_CONFIG_SUBDIRS], [
AC_CONFIG_SUBDIRS([$1])
ac_sub_configure_args=
ac_prev=
eval "set x $ac_configure_args"
Expand Down Expand Up @@ -96,3 +97,6 @@ AC_DEFUN([lldp_CONFIG_SUBDIRS], [
_AS_ECHO([$ac_msg])
cd "$ac_popdir"
])

# Dummy AC_CONFIG_SUBDIRS for autoreconf tracing
AC_DEFUN([AC_CONFIG_SUBDIRS], [])

0 comments on commit b41cea3

Please sign in to comment.