summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-04-10 01:01:30 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-04-10 01:01:30 (EDT)
commit5585fe8f42ec239a5e0fa3fa7c1f4e937a945c8c (patch)
tree1401f03902e2a152532c8be47d9503a49d386849 /configure.ac
parent354fd85e386e378fea4d70c233b5474d0135a9b0 (diff)
configure.ac, 3rdparty/local.mk: Optionally use system usign
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac75
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()