Skip to content

Commit

Permalink
Improve indentation in m4 files.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis95 committed Feb 21, 2022
1 parent cc0c874 commit f5d6b64
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 51 deletions.
13 changes: 7 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ AC_PROG_INSTALL
AC_CHECK_TOOL([STRIP], [strip], [:])

AC_ARG_WITH([liblzma], [AS_HELP_STRING([--without-liblzma],
[disable xz support through liblzma])], [], [with_liblzma=yes])
[disable xz support through liblzma])], [], [with_liblzma=yes])
AS_IF([test "$with_liblzma" != no],
[DX_PKG_CONFIG_LIB([liblzma],
[AC_DEFINE([WITH_LIBLZMA], [1], [Define to 1 if building with liblzma.])])])
[DX_PKG_CONFIG_LIB([liblzma],
[AC_DEFINE([WITH_LIBLZMA], [1], [Define to 1 if building with liblzma.])
])])

AC_ARG_WITH([zlib], [AS_HELP_STRING([--without-zlib],
[disable gzip support through zlib])], [], [with_zlib=yes])
[disable gzip support through zlib])], [], [with_zlib=yes])
AS_IF([test "$with_zlib" != no],
[DX_PKG_CONFIG_LIB([zlib],
[AC_DEFINE([WITH_ZLIB], [1], [Define to 1 if building with zlib.])])])
[DX_PKG_CONFIG_LIB([zlib],
[AC_DEFINE([WITH_ZLIB], [1], [Define to 1 if building with zlib.])])])

DX_ENABLE_WRAPPERS

Expand Down
15 changes: 8 additions & 7 deletions m4/check-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Check whether the C compiler accepts FLAG and append it to CFLAGS if accepted.
AC_DEFUN([DX_CHECK_CFLAGS],
[AS_VAR_PUSHDEF([dx_cache_var], [AS_TR_SH([dx_cv_cflags_$1])])dnl
AC_CACHE_CHECK([whether $CC accepts $1], [dx_cache_var],
[dx_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [dx_cache_var=yes], [dx_cache_var=no])
CFLAGS="$dx_save_CFLAGS"])
AS_VAR_IF([dx_cache_var], [yes], [CFLAGS="$CFLAGS $1"])
AS_VAR_POPDEF([dx_cache_var])dnl
AC_CACHE_CHECK([whether $CC accepts $1], [dx_cache_var],
[dx_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [dx_cache_var=yes],
[dx_cache_var=no])
CFLAGS="$dx_save_CFLAGS"])
AS_VAR_IF([dx_cache_var], [yes], [CFLAGS="$CFLAGS $1"])
AS_VAR_POPDEF([dx_cache_var])dnl
])
29 changes: 14 additions & 15 deletions m4/pkg-config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@
# Check for the pkg-config program.
AC_DEFUN([DX_PROG_PKG_CONFIG],
[AC_ARG_VAR([PKG_CONFIG], [path to the pkg-config program])dnl
AC_CHECK_TOOL([PKG_CONFIG], [pkg-config])
AS_VAR_IF([PKG_CONFIG], [],
[AC_MSG_ERROR([The pkg-config program was not found.])])dnl
AC_CHECK_TOOL([PKG_CONFIG], [pkg-config])
AS_VAR_IF([PKG_CONFIG], [],
[AC_MSG_ERROR([The pkg-config program was not found.])])dnl
])

# DX_PKG_CONFIG_LIB(LIBRARY, ACTION-IF-FOUND)
# Set CFLAGS and LIBS as needed for the given LIBRARY. Run ACTION-IF-FOUND if
# the library is found.
AC_DEFUN([DX_PKG_CONFIG_LIB],
[AC_REQUIRE([DX_PROG_PKG_CONFIG])dnl
AC_CACHE_CHECK([for $1 library], [dx_cv_pkg_config_$1],
[AS_IF([$PKG_CONFIG --exists $1], [dx_cv_pkg_config_$1=yes],
[dx_cv_pkg_config_$1=no])])
AS_VAR_IF([dx_cv_pkg_config_$1], [yes],
[AC_CACHE_CHECK([for CFLAGS needed for $1], [dx_cv_pkg_config_$1_cflags],
[dx_cv_pkg_config_$1_cflags=$($PKG_CONFIG --cflags $1)])
AC_CACHE_CHECK([for LIBS needed for $1], [dx_cv_pkg_config_$1_libs],
[dx_cv_pkg_config_$1_libs=$($PKG_CONFIG --libs $1)])
CFLAGS="$CFLAGS $dx_cv_pkg_config_$1_cflags"
LIBS="$dx_cv_pkg_config_$1_libs $LIBS"
$2dnl
])dnl
AC_CACHE_CHECK([for $1 library], [dx_cv_pkg_config_$1],
[AS_IF([$PKG_CONFIG --exists $1], [dx_cv_pkg_config_$1=yes],
[dx_cv_pkg_config_$1=no])])
AS_VAR_IF([dx_cv_pkg_config_$1], [yes],
[AC_CACHE_CHECK([for CFLAGS needed for $1], [dx_cv_pkg_config_$1_cflags],
[dx_cv_pkg_config_$1_cflags=$($PKG_CONFIG --cflags $1)])
AC_CACHE_CHECK([for LIBS needed for $1], [dx_cv_pkg_config_$1_libs],
[dx_cv_pkg_config_$1_libs=$($PKG_CONFIG --libs $1)])
CFLAGS="$CFLAGS $dx_cv_pkg_config_$1_cflags"
LIBS="$dx_cv_pkg_config_$1_libs $LIBS"
$2])dnl
])
45 changes: 22 additions & 23 deletions m4/wrappers.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@
# Decide which wrappers scripts should be installed.
AC_DEFUN([DX_ENABLE_WRAPPERS],
[dx_wrap_gzip=no
dx_wrap_xz=no
AC_ARG_ENABLE([wrappers], [AS_HELP_STRING([--enable-wrappers=WRAPPERS],
[create wrapper scripts for the given utilities])],
[dx_save_IFS=$IFS
IFS=,
for dx_value in $enableval; do
case $dx_value in
gzip) dx_wrap_gzip=yes ;;
xz) dx_wrap_xz=yes ;;
no) ;;
*) AC_MSG_WARN([unknown wrapper name $dx_value])
esac
done
IFS=$dx_save_IFS[]dnl
])
WRAPPERS="uncompress zcat"
AS_VAR_IF([dx_wrap_gzip], [yes], [AS_VAR_IF([dx_cv_pkg_config_zlib],
[yes], [WRAPPERS="$WRAPPERS gzip gunzip"],
[AC_MSG_WARN([cannot provide gzip wrappers without zlib])])])
AS_VAR_IF([dx_wrap_xz], [yes], [AS_VAR_IF([dx_cv_pkg_config_liblzma],
[yes], [WRAPPERS="$WRAPPERS xz unxz xzcat"],
[AC_MSG_WARN([cannot provide xz wrappers without liblzma])])])
AC_SUBST([WRAPPERS])dnl
dx_wrap_xz=no
AC_ARG_ENABLE([wrappers], [AS_HELP_STRING([--enable-wrappers=WRAPPERS],
[create wrapper scripts for the given utilities])],
[dx_save_IFS=$IFS
IFS=,
for dx_value in $enableval; do
case $dx_value in
gzip) dx_wrap_gzip=yes ;;
xz) dx_wrap_xz=yes ;;
no) ;;
*) AC_MSG_WARN([unknown wrapper name $dx_value])
esac
done
IFS=$dx_save_IFS[]])
WRAPPERS="uncompress zcat"
AS_VAR_IF([dx_wrap_gzip], [yes], [AS_VAR_IF([dx_cv_pkg_config_zlib],
[yes], [WRAPPERS="$WRAPPERS gzip gunzip"],
[AC_MSG_WARN([cannot provide gzip wrappers without zlib])])])
AS_VAR_IF([dx_wrap_xz], [yes], [AS_VAR_IF([dx_cv_pkg_config_liblzma],
[yes], [WRAPPERS="$WRAPPERS xz unxz xzcat"],
[AC_MSG_WARN([cannot provide xz wrappers without liblzma])])])
AC_SUBST([WRAPPERS])dnl
])

0 comments on commit f5d6b64

Please sign in to comment.