Commit efef6c82 authored by Samuel Iglesias Gonsálvez's avatar Samuel Iglesias Gonsálvez Committed by Iago Toral

configure: add check for GNU indent

Only GNU indent is supported when indenting autogenerated format_pack.c
and format_unpack.c files. Some non-GNU indent (Mac OS X and FreeBSD)
add extra whitespaces than break the build of those files.

Fallback to 'cat' if a non-GNU indent is found.

Fixes: Samuel Iglesias Gonsálvez's avatarSamuel Iglesias Gonsalvez <>
Tested-by: Vinson Lee's avatarVinson Lee <>
Reviewed-by: Matt Turner's avatarMatt Turner <>
parent 6d43a4c3
......@@ -73,7 +73,13 @@ AX_PROG_FLEX([],
AC_CHECK_PROG(INDENT, indent, indent, cat)
if test "x$INDENT" != "xcat"; then
AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
# Only GNU indent is supported
INDENT_VERSION=`indent --version | grep GNU`
if test $? -eq 0; then
AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment