Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Shafer committed Aug 5, 2014
2 parents 827771c + 9697d28 commit cce7de4
Show file tree
Hide file tree
Showing 66 changed files with 26,349 additions and 33,647 deletions.
4 changes: 2 additions & 2 deletions bin/Zaliases
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ set opts=' \
--with-libslax-prefix=/Users/phil/work/root \
--with-lighttpd-obj=/Users/phil/work/slax/lighttpd-for-juise/build \
--with-lighttpd-src=/Users/phil/work/slax/lighttpd-for-juise \
--with-libssh2-prefix=/Users/phil/work/root \
--with-sqlite3-prefix=/opt/local \
--with-ssh2=/Users/phil/work/root \
--with-sqlite3=/opt/local \
--with-lighttpd-lib=/Users/phil/work/root/lib \
--with-php-cgi=/opt/local/bin/php-cgi \
'
Expand Down
114 changes: 32 additions & 82 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
#
LIBXML_REQUIRED_VERSION=2.7.7
LIBXSLT_REQUIRED_VERSION=1.1.26
LIBSLAX_REQUIRED_VERSION=0.12.3
LIBSSH2_REQUIRED_VERSION=1.4.2
SQLITE3_REQUIRED_VERSION=3.0.0
LIBSLAX_REQUIRED_VERSION=0.18.0

AC_PROG_CC
AM_PROG_AR
Expand Down Expand Up @@ -403,87 +401,47 @@ AC_SUBST(SLAX_OXTRADOCDIR)
# ---- handle libssh2 (which does not have a libssh2-config)
#

AC_ARG_WITH(libssh2-prefix,
[ --with-libssh2-prefix=[PFX] Specify location of libssh2 config],
LIBSSH2_PREFIX=$withval,
LIBSSH2_PREFIX=$prefix
)

AC_ARG_WITH(libssh2-include-prefix,
[ --with-libssh2-include-prefix=[PFX] Specify location of libssh2 headers],
LIBSSH2_INCLUDE="$withval",
LIBSSH2_INCLUDE="$LIBSSH2_PREFIX/include",
)
LIBSSH2_CFLAGS=-I$LIBSSH2_INCLUDE

AC_ARG_WITH(libssh2-libs-prefix,
[ --with-libssh2-libs-prefix=[PFX] Specify location of libssh2 libs],
LIBSSH2_LIBS="-L$withval -lssh2",
LIBSSH2_LIBS="-L$LIBSSH2_PREFIX/lib -lssh2"
)

AC_MSG_CHECKING([version of libssh])

if test -f $LIBSSH2_INCLUDE/libssh2.h
AC_ARG_WITH(ssh2,
AC_HELP_STRING([--with-ssh2=PATH],[Use libssh2 installed under PATH]),
[
case $with_ssh2 in
*)
LDFLAGS="$LDFLAGS -L$with_ssh2/lib"
CPPFLAGS="$CPPFLAGS -I$with_ssh2/include"
;;
esac
])

HAVE_LIBSSH2=no
AC_CHECK_LIB(ssh2, libssh2_channel_open_ex, HAVE_LIBSSH2=yes, HAVE_LIBSSH2=no)
if test "$HAVE_LIBSSH2" == "no" -a "$NEED_MIXER" == "yes"
then
LIBSSH2_VERSION=`grep 'LIBSSH2_VERSION ' $LIBSSH2_INCLUDE/libssh2.h | awk -F'"' '{print $2}'`

if test VERSION_TO_NUMBER(echo $LIBSSH2_VERSION) -ge VERSION_TO_NUMBER(echo $LIBSSH2_REQUIRED_VERSION)
then
AC_MSG_RESULT($LIBSSH2_VERSION found)
else
AC_MSG_ERROR(Version $LIBSSH2_VERSION found. You need at least libssh2 $LIBSSH2_REQUIRED_VERSION for this version of juise)
fi
else
AC_MSG_NOTICE([libssh2 not found; see http://www.libssh2.org/.])
NEED_MIXER=no
AC_MSG_ERROR(--enable-mixer specified but libssh2 libraries not installed)
fi

AC_SUBST(LIBSSH2_CFLAGS)
AC_SUBST(LIBSSH2_LIBS)

#
# ---- handle sqlite3
#

AC_ARG_WITH(sqlite3-prefix,
[ --with-sqlite3-prefix=[PFX] Specify location of sqlite3 config],
SQLITE3_PREFIX=$withval,
SQLITE3_PREFIX=$prefix
)

AC_ARG_WITH(sqlite3-include-prefix,
[ --with-sqlite3-include-prefix=[PFX] Specify location of sqlite3 headers],
SQLITE3_INCLUDE="$withval",
SQLITE3_INCLUDE="$SQLITE3_PREFIX/include",
)
SQLITE3_CFLAGS=-I$SQLITE3_INCLUDE

AC_ARG_WITH(sqlite3-libs-prefix,
[ --with-sqlite3-libs-prefix=[PFX] Specify location of sqlite3 libs],
SQLITE3_LIBS="-L$withval -lsqlite3",
SQLITE3_LIBS="-L$SQLITE3_PREFIX/lib -lsqlite3"
)

AC_MSG_CHECKING([version of sqlite3])

if test -f $SQLITE3_INCLUDE/sqlite3.h
AC_ARG_WITH(sqlite3,
AC_HELP_STRING([--with-sqlite3=PATH],[Use sqlite3 installed under PATH]),
[
case $with_sqlite3 in
*)
LDFLAGS="$LDFLAGS -L$with_sqlite3/lib"
CPPFLAGS="$CPPFLAGS -I$with_sqlite3/include"
;;
esac
])

HAVE_SQLITE3=no
AC_CHECK_LIB(sqlite3, sqlite3_open, HAVE_SQLITE3=yes, HAVE_SQLITE3=no)

if test "$HAVE_SQLITE3" == "no" -a "$NEED_MIXER" == "yes"
then
SQLITE3_VERSION=`grep 'SQLITE_VERSION ' $SQLITE3_INCLUDE/sqlite3.h | awk -F'"' '{print $2}'`

if test VERSION_TO_NUMBER(echo $SQLITE3_VERSION) -ge VERSION_TO_NUMBER(echo $SQLITE3_REQUIRED_VERSION)
then
AC_MSG_RESULT($SQLITE3_VERSION found)
else
AC_MSG_ERROR(Version $SQLITE3_VERSION found. You need at least sqlite3 $SQLITE3_REQUIRED_VERSION for this version of juise)
fi
else
AC_MSG_NOTICE([sqlite3 not found; see http://www.sqlite.org/.])
AC_MSG_ERROR(--enable-mixer specified but libsqlite3 libraries not installed)
fi

AC_SUBST(SQLITE3_CFLAGS)
AC_SUBST(SQLITE3_LIBS)

#
# ---- end of noise
#
Expand Down Expand Up @@ -697,14 +655,6 @@ AC_MSG_NOTICE([summary of build options:
libslax libdir: ${SLAX_LIBDIR}
libslax extdir: ${SLAX_EXTDIR}
libssh2 version: ${LIBSSH2_VERSION}
libssh2 cflags: ${LIBSSH2_CFLAGS}
libssh2 libs: ${LIBSSH2_LIBS}
sqlite3 version: ${SQLITE3_VERSION}
sqlite3 cflags: ${SQLITE3_CFLAGS}
sqlite3 libs: ${SQLITE3_LIBS}
libpcre cflags: ${PCRE_CFLAGS}
libpcre libs: ${PCRE_LIB}
Expand Down
37 changes: 33 additions & 4 deletions juise/juise.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,8 +1168,7 @@ rpc_parse_mime_list (char *str)
}

if (i == (sizeof(mtypemap) / sizeof(rpc_media_type_map_t))) {
fprintf(stdout, "Content-Type: " MEDIA_TYPE_APPLICATION_XML "\n\n");
fflush(stdout);
output_format = strdup( MEDIA_TYPE_APPLICATION_XML );
}

if (output_format != NULL)
Expand Down Expand Up @@ -1225,7 +1224,7 @@ rpc_build_data (lx_document_t *docp, lx_node_t *nodep, char *str)
if (childp) {
cur = childp->xmlChildrenNode;
while (cur != NULL) {
newp = xmlDocCopyNode(childp, docp, 1);
newp = xmlDocCopyNode(cur, docp, 1);
if (newp) {
xmlAddChild(nodep, newp);
} else {
Expand Down Expand Up @@ -1400,7 +1399,7 @@ do_run_rpc (const char *scriptname UNUSED, const char *input UNUSED,
/* Parse Accept header and set output format */
accept_header = getenv("HTTP_ACCEPT");

if (accept_header && !output_format) {
if (!output_format) {
output_format = rpc_parse_mime_list(accept_header);

if (output_format == NULL) {
Expand Down Expand Up @@ -1699,6 +1698,7 @@ print_help (void)
"\t--junoscript OR -J: use junoscript API protocol\n"
"\t--load OR -l: load commit script changes in test mode\n"
"\t--lib <dir> OR -L <dir>: search directory for extension libraries\n"
"\t--mixer OR -M: use mixer connection (if available)\n"
"\t--no-randomize: do not initialize the random number generator\n"
"\t--param <name> <value> OR -a <name> <value>: pass parameters\n"
"\t--protocol <name> OR -P <name>: use the given API protocol\n"
Expand Down Expand Up @@ -1817,6 +1817,9 @@ main (int argc UNUSED, char **argv, char **envp)
} else if (streq(cp, "--lib") || streq(cp, "-L")) {
slaxDynAdd(*++argv);

} else if (streq(cp, "--mixer") || streq(cp, "-M")) {
jsio_set_mixer(*++argv);

} else if (streq(cp, "--no-randomize")) {
randomize = 0;

Expand Down Expand Up @@ -1890,6 +1893,15 @@ main (int argc UNUSED, char **argv, char **envp)
} else if (streq(cp, "--xml")) {
func = do_emit_xml;

} else if (streq(cp, "--auth-muxer-id")) {
jsio_set_auth_muxer_id(cp);

} else if (streq(cp, "--auth-websocket-id")) {
jsio_set_auth_websocket_id(cp);

} else if (streq(cp, "--auth-div-id")) {
jsio_set_auth_div_id(cp);

} else {
fprintf(stderr, "invalid option: %s\n", cp);
print_help();
Expand Down Expand Up @@ -2012,6 +2024,8 @@ main (int argc UNUSED, char **argv, char **envp)
slaxLogEnable(TRUE);

exsltRegisterAll();
slaxDynMarkExslt();

ext_jcs_register_all();

jsio_init(jsio_flags);
Expand All @@ -2028,6 +2042,21 @@ main (int argc UNUSED, char **argv, char **envp)
if (ssh_agent_forwarding)
jsio_add_ssh_options("-A");

cp = getenv("HTTP_X_MIXER_AUTH_MUXER_ID");
if (cp) {
jsio_set_auth_muxer_id(cp);
}

cp = getenv("HTTP_X_MIXER_AUTH_WEBSOCKET_ID");
if (cp) {
jsio_set_auth_websocket_id(cp);
}

cp = getenv("HTTP_X_MIXER_AUTH_DIV_ID");
if (cp) {
jsio_set_auth_div_id(cp);
}

if (opt_ignore_arguments) {
static char *null_args[] = { NULL };
argv = null_args;
Expand Down
2 changes: 2 additions & 0 deletions libjuise/xml/extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,8 @@ ext_jcs_register_all (void)
slaxRegisterFunction(JCS_FULL_NS, "receive", ext_jcs_receive);
slaxRegisterFunction(JCS_FULL_NS, "send", ext_jcs_send);

slaxDynMarkLoaded(JCS_FULL_NS);

return 0;
}

Expand Down
Loading

0 comments on commit cce7de4

Please sign in to comment.