You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to ./configure --with-yajl YAJL can never be found. If I specify --with-yajl="/usr/include/yajl" it will find the YAJL headers, but still report that YAJL was not found. If I include multiple paths in --with-yajl="" it continues to find nothing.
I tried to uninstall libyajl-dev from my package manager and manually compile yajl from sources. I experieced the same results with any combination of /usr/local/{include,lib} in the path.
After some digging I found that ./build/yajl.m4 tries to use pkg-config to find YAJL first, and then falls back to directory scanning. However, it appears the list of directories to check is stored in YAJL_POSSIBLE_PATHS while the script is passing YAJL_POSSIBLE_LIB_NAMES to CHECK_FOR_YAJL_AT() on line 65.
# 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
Reviewing the definition of CHECK_FOR_YAJL_AT() it expects 'path' as the first argumant, and then loops through the YAJL_POSSIBLE_EXTENSIONS and YAJL_POSSIBLE_LIB_NAMES inside the function to search that path.
AC_DEFUN([CHECK_FOR_YAJL_AT], [
path=$1
for y in ${YAJL_POSSIBLE_EXTENSIONS}; do
for z in ${YAJL_POSSIBLE_LIB_NAMES}; do
...
By modifying the loop defined on line 65 to loop over YAJL_POSSIBLE_PATHS instead of YAJL_POSSIBLE_LIB_NAMES and running ./build.sh again, YAJL is found correctly.
Additionally, if multiple directories are provided, for example --with-yajl="<dir1> <dir2>", they are not all searched. Instead they are treated as a single directory. In the yajl.m4 file on line 73 the script checks for --with-yajl with an argument and passes the argument to CHECK_FOR_YAJL_AT() as a path. Instead, it would be optimal to loop over provided paths and search each one.
Logs and dumps
There was no useful log information. The config.log simply reported that YAJL could not be found and/or that sometimes the headers were found, but that YAJL still was not found. There was no indication that paths were being checked at all.
When searching for YAJL during ./configure, pkg-config is checked first,
and then a list of directories is searched if pkg-config bears no fruit.
The previous version of yajl.m4 was looping over YAJL_POSSIBLE_LIB_NAMES
instead of YAJL_POSSIBLE_PATHS and passing the lib name to the
CHECK_FOR_YAJL_AT() function instead of the path. The would lead to YAJL
never being found if pkg-config could not find it.
Describe the bug
When trying to
./configure --with-yajl
YAJL can never be found. If I specify--with-yajl="/usr/include/yajl"
it will find the YAJL headers, but still report that YAJL was not found. If I include multiple paths in--with-yajl=""
it continues to find nothing.I tried to uninstall libyajl-dev from my package manager and manually compile yajl from sources. I experieced the same results with any combination of
/usr/local/{include,lib}
in the path.After some digging I found that
./build/yajl.m4
tries to use pkg-config to find YAJL first, and then falls back to directory scanning. However, it appears the list of directories to check is stored inYAJL_POSSIBLE_PATHS
while the script is passingYAJL_POSSIBLE_LIB_NAMES
toCHECK_FOR_YAJL_AT()
on line 65.Reviewing the definition of
CHECK_FOR_YAJL_AT()
it expects 'path' as the first argumant, and then loops through theYAJL_POSSIBLE_EXTENSIONS
andYAJL_POSSIBLE_LIB_NAMES
inside the function to search that path.By modifying the loop defined on line 65 to loop over
YAJL_POSSIBLE_PATHS
instead ofYAJL_POSSIBLE_LIB_NAMES
and running ./build.sh again, YAJL is found correctly.Additionally, if multiple directories are provided, for example
--with-yajl="<dir1> <dir2>"
, they are not all searched. Instead they are treated as a single directory. In the yajl.m4 file on line 73 the script checks for--with-yajl
with an argument and passes the argument toCHECK_FOR_YAJL_AT()
as a path. Instead, it would be optimal to loop over provided paths and search each one.Logs and dumps
There was no useful log information. The config.log simply reported that YAJL could not be found and/or that sometimes the headers were found, but that YAJL still was not found. There was no indication that paths were being checked at all.
To Reproduce
Steps to reproduce the behavior:
You can try any combination of paths in
--with-yajl
and it fails to find it.Expected behavior
Obviously the expected behaviour is that YAJL should be found if specifying --with-yajl.
Server (please complete the following information):
The text was updated successfully, but these errors were encountered: