diff options
-rw-r--r-- | 3rdparty/local.mk | 5 | ||||
-rw-r--r-- | configure.ac | 75 |
2 files changed, 56 insertions, 24 deletions
diff --git a/3rdparty/local.mk b/3rdparty/local.mk index bd9b377..377d1df 100644 --- a/3rdparty/local.mk +++ b/3rdparty/local.mk @@ -1,12 +1,11 @@ pkglibexecdir = $(libexecdir)/$(PACKAGE) +if EMBEDDED_USIGN pkglibexec_SCRIPTS = 3rdparty/usign/usign$(EXEEXT) - 3rdparty/usign/usign$(EXEEXT): (cd 3rdparty/usign/ && make) - clean-local: -(cd 3rdparty/usign/ && make clean) - distclean-local: -rm -Rf 3rdparty/usign/CMakeFiles/ -rm -f 3rdparty/usign/CMakeCache.txt 3rdparty/usign/cmake_install.cmake +endif 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() |