diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 75 |
1 files changed, 54 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac index 600820f..33faa6b 100644 --- a/configure.ac +++ b/configure.ac @@ -165,42 +165,75 @@ AC_ARG_WITH( ] ) -AC_CONFIG_FILES([Makefile]) -AC_CONFIG_FILES([config.sh]) -AC_CONFIG_FILES([tests/aux/defs.sh]) -AC_OUTPUT() - # # usign # AC_ARG_WITH( - [cmake], - [AS_HELP_STRING([--with-cmake=PATH], [path to cmake utility])], + [system-usign], + [AS_HELP_STRING([--with-system-usign[=PATH]], [use system usign])], [ case "${withval}" in 'yes'|'') - AC_MSG_ERROR( - [--with-cmake requires an argument]) + AC_PATH_PROG([USIGN], [usign]) + if test -z "${USIGN}"; then + AC_MSG_ERROR([usign not found]) + fi + embedded_usign=false ;; 'no') - AC_MSG_ERROR([cmake is required]) + embedded_usign=true ;; *) - CMAKE="${withval}" - AC_SUBST([CMAKE]) + USIGN="${withval}" + AC_SUBST([USIGN]) + embedded_usign=false ;; esac ], [ - AC_PATH_PROG([CMAKE], [cmake]) - if test -z "${CMAKE}"; then - AC_MSG_ERROR([cmake not found]) - fi + embedded_usign=true ] ) -AS_MKDIR_P([3rdparty/usign]) -abs_srcdir="$(cd "${srcdir}" && pwd)" -( - cd 3rdparty/usign - "${CMAKE}" -D USE_LIBUBOX:BOOL=OFF "${abs_srcdir}/3rdparty/usign" +AC_ARG_WITH( + [cmake], + [AS_HELP_STRING([--with-cmake=PATH], [path to cmake utility])], + [ + if ${embedded_usign}; then + case "${withval}" in + 'yes'|'') + AC_MSG_ERROR([--with-cmake requires an + argument]) + ;; + 'no') + AC_MSG_ERROR([cmake is required]) + ;; + *) + CMAKE="${withval}" + AC_SUBST([CMAKE]) + ;; + esac + fi + ], + [ + if ${embedded_usign}; then + AC_PATH_PROG([CMAKE], [cmake]) + if test -z "${CMAKE}"; then + AC_MSG_ERROR([cmake not found]) + fi + fi + ] ) +if ${embedded_usign}; then + AS_MKDIR_P([3rdparty/usign]) + abs_srcdir="$(cd "${srcdir}" && pwd)" + ( + cd 3rdparty/usign + "${CMAKE}" -DUSE_LIBUBOX:BOOL=OFF "${abs_srcdir}/3rdparty/usign" + ) +fi +AM_CONDITIONAL([EMBEDDED_USIGN], [${embedded_usign}]) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([config.sh]) +AC_CONFIG_FILES([tests/aux/defs.sh]) +AC_OUTPUT() |