Skip to content

Commit

Permalink
Allow ./configure --with-oniguruma=builtin
Browse files Browse the repository at this point in the history
This allows one to force the use of jq's builtin copy of Oniguruma
(builtin as a git submodule).

We still need to fix make dist to include that copy of Oniguruma.
  • Loading branch information
nicowilliams committed Feb 23, 2017
1 parent 8cde328 commit c6374b6
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -236,24 +236,32 @@ AS_IF([test "x$with_oniguruma" != xno], [
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
AS_IF([test "x$with_oniguruma" != xyes], [
onig_CFLAGS="-I${with_oniguruma}/include"
onig_LDFLAGS="-L${with_oniguruma}/lib"
CFLAGS="$CFLAGS $onig_CFLAGS"
LDFLAGS="$LDFLAGS $onig_LDFLAGS"
AS_IF([test "x$with_oniguruma" = xbuiltin], [
build_oniguruma=yes
], [
onig_CFLAGS="-I${with_oniguruma}/include"
onig_LDFLAGS="-L${with_oniguruma}/lib"
CFLAGS="$CFLAGS $onig_CFLAGS"
LDFLAGS="$LDFLAGS $onig_LDFLAGS"
])
])
# check for ONIGURUMA library
AC_CHECK_HEADER("oniguruma.h",
AC_CHECK_LIB([onig],[onig_version]))
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
# handle check results
AS_IF([test "x$ac_cv_lib_onig_onig_version" != "xyes"], [
onig_CFLAGS="-I${srcdir}/modules/oniguruma/src"
onig_LDFLAGS=
AC_CONFIG_SUBDIRS([modules/oniguruma])
build_oniguruma=yes
AC_MSG_NOTICE([Oniguruma was not found. Will use the packaged oniguruma.])
AS_IF([test "x$build_oniguruma" = xno], [
# check for ONIGURUMA library
AC_CHECK_HEADER("oniguruma.h",
AC_CHECK_LIB([onig],[onig_version]))
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
# handle check results
AS_IF([test "x$ac_cv_lib_onig_onig_version" != "xyes"], [
build_oniguruma=yes
AC_MSG_NOTICE([Oniguruma was not found. Will use the packaged oniguruma.])
])
])
AS_IF([test "x$build_oniguruma" = xyes], [
onig_CFLAGS="-I${srcdir}/modules/oniguruma/src"
onig_LDFLAGS=
AC_CONFIG_SUBDIRS([modules/oniguruma])
])
AC_SUBST(onig_CFLAGS)
AC_SUBST(onig_LDFLAGS)
Expand Down

0 comments on commit c6374b6

Please sign in to comment.