-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Enforce YAJL mandatory dependency in configuration and codebase #3151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
eduar-hte
wants to merge
3
commits into
owasp-modsecurity:v3/master
from
eduar-hte:mandatory-dependencies
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
Makefile.am
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
|
||
if TEST_UTILITIES | ||
export MAYBE_TEST = test | ||
endif | ||
|
||
if EXAMPLES | ||
export MAYBE_EXAMPLES = examples | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
dnl Check for YAJL Libraries | ||
dnl CHECK_YAJL(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) | ||
|
||
AC_DEFUN([PROG_YAJL], [ | ||
AC_DEFUN([CHECK_YAJL], [ | ||
|
||
# Possible names for the yajl library/package (pkg-config) | ||
YAJL_POSSIBLE_LIB_NAMES="yajl2 yajl" | ||
|
@@ -24,80 +24,52 @@ AC_ARG_WITH( | |
[AS_HELP_STRING([--with-yajl=PATH],[Path to yajl prefix or config script])] | ||
) | ||
|
||
if test "x${with_yajl}" == "xno"; then | ||
AC_DEFINE(HAVE_YAJL, 0, [Support for YAJL was disabled by the utilization of --without-yajl or --with-yajl=no]) | ||
AC_MSG_NOTICE([Support for YAJL was disabled by the utilization of --without-yajl or --with-yajl=no]) | ||
YAJL_DISABLED=yes | ||
else | ||
if test "x${with_yajl}" == "xyes"; then | ||
YAJL_MANDATORY=yes | ||
AC_MSG_NOTICE([YAJL support was marked as mandatory by the utilization of --with-yajl=yes]) | ||
fi | ||
# for x in ${YAJL_POSSIBLE_LIB_NAMES}; do | ||
# CHECK_FOR_YAJL_AT(${x}) | ||
# if test -n "${YAJL_VERSION}"; then | ||
# break | ||
# fi | ||
# done | ||
|
||
# if test "x${with_yajl}" != "xyes" or test "x${with_yajl}" == "xyes"; then | ||
if test "x${with_yajl}" == "x" || test "x${with_yajl}" == "xyes"; then | ||
# Nothing about YAJL was informed, using the pkg-config to figure things out. | ||
if test -n "${PKG_CONFIG}"; then | ||
YAJL_PKG_NAME="" | ||
for x in ${YAJL_POSSIBLE_LIB_NAMES}; do | ||
if ${PKG_CONFIG} --exists ${x}; then | ||
YAJL_PKG_NAME="$x" | ||
break | ||
fi | ||
done | ||
YAJL_MANDATORY=yes | ||
AC_MSG_NOTICE([YAJL is mandatory]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a regular comment I'll explain why is this not a good idea. |
||
|
||
|
||
if test "x${with_yajl}" == "x" || test "x${with_yajl}" == "xyes"; then | ||
# Nothing about YAJL was informed, using the pkg-config to figure things out. | ||
if test -n "${PKG_CONFIG}"; then | ||
YAJL_PKG_NAME="" | ||
for x in ${YAJL_POSSIBLE_LIB_NAMES}; do | ||
if ${PKG_CONFIG} --exists ${x}; then | ||
YAJL_PKG_NAME="$x" | ||
break | ||
fi | ||
AC_MSG_NOTICE([Nothing about YAJL was informed during the configure phase. Trying to detect it on the platform...]) | ||
if test -n "${YAJL_PKG_NAME}"; then | ||
# Package was found using the pkg-config scripts | ||
YAJL_VERSION="`${PKG_CONFIG} ${YAJL_PKG_NAME} --modversion`" | ||
YAJL_CFLAGS="`${PKG_CONFIG} ${YAJL_PKG_NAME} --cflags`" | ||
YAJL_LDADD="`${PKG_CONFIG} ${YAJL_PKG_NAME} --libs-only-l`" | ||
YAJL_LDFLAGS="`${PKG_CONFIG} ${YAJL_PKG_NAME} --libs-only-L --libs-only-other`" | ||
YAJL_DISPLAY="${YAJL_LDADD}, ${YAJL_CFLAGS}" | ||
else | ||
# If pkg-config did not find anything useful, go over file lookup. | ||
for x in ${YAJL_POSSIBLE_LIB_NAMES}; do | ||
CHECK_FOR_YAJL_AT(${x}) | ||
if test -n "${YAJL_VERSION}"; then | ||
break | ||
fi | ||
done | ||
done | ||
fi | ||
AC_MSG_NOTICE([Nothing about YAJL was informed during the configure phase. Trying to detect it on the platform...]) | ||
if test -n "${YAJL_PKG_NAME}"; then | ||
# Package was found using the pkg-config scripts | ||
YAJL_VERSION="`${PKG_CONFIG} ${YAJL_PKG_NAME} --modversion`" | ||
YAJL_CFLAGS="`${PKG_CONFIG} ${YAJL_PKG_NAME} --cflags`" | ||
YAJL_LDADD="`${PKG_CONFIG} ${YAJL_PKG_NAME} --libs-only-l`" | ||
YAJL_LDFLAGS="`${PKG_CONFIG} ${YAJL_PKG_NAME} --libs-only-L --libs-only-other`" | ||
else | ||
# If pkg-config did not find anything useful, go over file lookup. | ||
for x in ${YAJL_POSSIBLE_PATHS}; do | ||
CHECK_FOR_YAJL_AT(${x}) | ||
if test -n "${YAJL_LDADD}"; then | ||
break | ||
fi | ||
fi | ||
if test "x${with_yajl}" != "x"; then | ||
# An specific path was informed, lets check. | ||
YAJL_MANDATORY=yes | ||
CHECK_FOR_YAJL_AT(${with_yajl}) | ||
fi | ||
# fi | ||
done | ||
fi | ||
elif test "x${with_yajl}" != "x"; then | ||
# A specific path was informed, let's check. | ||
CHECK_FOR_YAJL_AT(${with_yajl}) | ||
fi | ||
|
||
if test -z "${YAJL_LDADD}"; then | ||
if test -z "${YAJL_MANDATORY}"; then | ||
if test -z "${YAJL_DISABLED}"; then | ||
AC_MSG_NOTICE([YAJL library was not found]) | ||
YAJL_FOUND=0 | ||
else | ||
YAJL_FOUND=2 | ||
fi | ||
else | ||
AC_MSG_ERROR([YAJL was explicitly referenced but it was not found]) | ||
YAJL_FOUND=-1 | ||
fi | ||
AC_MSG_ERROR([YAJL is mandatory but it was not found]) | ||
YAJL_FOUND=-1 | ||
else | ||
YAJL_FOUND=1 | ||
AC_MSG_NOTICE([using YAJL v${YAJL_VERSION}]) | ||
YAJL_CFLAGS="-DWITH_YAJL ${YAJL_CFLAGS}" | ||
YAJL_CFLAGS="${YAJL_CFLAGS}" | ||
YAJL_DISPLAY="${YAJL_LDADD}, ${YAJL_CFLAGS}" | ||
AC_SUBST(YAJL_VERSION) | ||
AC_SUBST(YAJL_LDADD) | ||
AC_SUBST(YAJL_LIBS) | ||
AC_SUBST(YAJL_LDFLAGS) | ||
AC_SUBST(YAJL_CFLAGS) | ||
AC_SUBST(YAJL_DISPLAY) | ||
|
@@ -107,7 +79,7 @@ fi | |
|
||
AC_SUBST(YAJL_FOUND) | ||
|
||
]) # AC_DEFUN [PROG_YAJL] | ||
]) # AC_DEFUN [CHECK_YAJL] | ||
|
||
|
||
AC_DEFUN([CHECK_FOR_YAJL_AT], [ | ||
|
@@ -164,6 +136,5 @@ AC_DEFUN([CHECK_FOR_YAJL_AT], [ | |
YAJL_CFLAGS="-I${yajl_inc_path}" | ||
YAJL_LDADD="-l${yajl_lib_name}" | ||
YAJL_LDFLAGS="-L${yajl_lib_path}" | ||
YAJL_DISPLAY="${yajl_lib_file}, ${yajl_inc_path}" | ||
fi | ||
]) # AC_DEFUN [CHECK_FOR_YAJL_AT] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.