Commit 6a3e5dc5 authored by Jondy Zhao's avatar Jondy Zhao

Use slapos.recipe.cmmi to install components.

Add patches of Cygwin.
parent aa14c55a
......@@ -3,6 +3,7 @@ parts = apache-php
extends =
../apache/buildout.cfg
../bison/buildout.cfg
../bzip2/buildout.cfg
../cclient/buildout.cfg
../curl/buildout.cfg
......@@ -19,54 +20,82 @@ extends =
[apache-php]
# Note: Shall react on each build of apache and reinstall itself
recipe = hexagonit.recipe.cmmi
depends =
${mariadb:version}
recipe = slapos.recipe.cmmi
dependencies = bison mariadb apache libxml2 zlib bzip2 libmcrypt libjpeg libpng freetype curl zip gettext openssl libtool libiconv
url = http://fr2.php.net/distributions/php-5.3.13.tar.gz
md5sum = 179c67ce347680f468edbfc3c425476a
configure-options =
--with-apxs2=${apache:location}/bin/apxs
--with-libxml-dir=${libxml2:location}
--with-mysql=${mariadb:location}
--with-zlib-dir=${zlib:location}
--with-bz2-dir=${bzip2:location}
--with-mcrypt=${libmcrypt:location}
--with-apxs2=${apache:prefix}/bin/apxs
--with-libxml-dir=${libxml2:prefix}
--with-mysql=${mariadb:prefix}
--with-zlib-dir=${zlib:prefix}
--with-mcrypt=${libmcrypt:prefix}
--with-gd
--with-jpeg-dir=${libjpeg:location}
--with-png-dir=${libpng:location}
--with-jpeg-dir=${libjpeg:prefix}
--with-png-dir=${libpng:prefix}
--enable-gd-native-ttf
--with-ttf
--with-freetype-dir=${freetype:location}
--with-freetype-dir=${freetype:prefix}
--with-pdo-mysql=mysqlnd
--with-mysqli=mysqlnd
--with-curl=${curl:location}
--with-zip-dir=${zip:location}
--with-imap=${cclient:location}
--with-iconv-dir=${libiconv:location}
--with-gettext=${gettext:location}
--with-ldap=${openldap:location}
--with-imap-ssl
--with-openssl=${openssl:location}
--with-curl=${curl:prefix}
--with-gettext=${gettext:prefix}
--with-openssl=${openssl:prefix}
--enable-libxml
--enable-mbstring
--enable-session
--enable-exif
--enable-ftp
[x86-linux-apache-php]
dependencies = ${apache-php:dependencies} cclient openldap
configure-options =
${apache-php:configure-options}
--with-imap=${cclient:prefix}
--with-ldap=${openldap:prefix}
--with-imap-ssl
--with-zip-dir=${zip:prefix}
--enable-zip
--with-bz2-dir=${bzip2:prefix}
--enable-bz2
--enable-ftp
--with-ttf
--with-iconv-dir=${libiconv:prefix}
environment =
PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig
PATH=${pkgconfig:location}/bin:${bzip2:location}/bin:${libxml2:location}/bin:%(PATH)s
LDFLAGS =-L${bzip2:location}/lib -Wl,-rpath -Wl,${bzip2:location}/lib -L${libtool:location}/lib -Wl,-rpath -Wl,${libtool:location}/lib -L${mariadb:location}/lib -Wl,-rpath -Wl,${mariadb:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -L${libmcrypt:location}/lib -Wl,-rpath -Wl,${libmcrypt:location}/libblkid
[x86-cygwin-apache-php]
pre-configure =
rm -f build/libtool.m4
ac_macrodir=build libtoolize --copy --force || error "libtoolize failed"
cat build/lt*.m4 >> build/libtool.m4
make -j1 -B -f build/build.mk ZENDDIR="Zend"
true
pre-build =
_X_=$(grep 'CFLAGS_CLEAN =' Makefile); _X_=$${_X_:15}; _X_=$${_X_//\//\\/}
sed -i -e "s/^LTCFLAGS=.*$/LTCFLAGS=\" $_X_ \"/g" -e "s/\/cyg\//\/lib\//g" libtool
configure-options =
${apache-php:configure-options}
--enable-zip=${zip:prefix}
--with-bz2=${bzip2:prefix}
--without-iconv
patch-options = -p2
patches = ${:_profile_base_location_}/cygwin-php-5.3.13.patch
[libmcrypt]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.bz2/download
md5sum = c4f491dd411a09e9de3b8702ea6f73eb
[xml-rpc]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://downloads.sourceforge.net/project/phpxmlrpc/phpxmlrpc/2.2.2/xmlrpc-2.2.2.tar.gz
md5sum = 59a644c636c6d98267d0c99b406ae9e8
[no-environment]
environment =
PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig
PATH=${pkgconfig:location}/bin:${bzip2:location}/bin:${libxml2:location}/bin:%(PATH)s
LDFLAGS =-L${bzip2:location}/lib -Wl,-rpath -Wl,${bzip2:location}/lib -L${libtool:location}/lib -Wl,-rpath -Wl,${libtool:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -L${libmcrypt:location}/lib -Wl,-rpath -Wl,${libmcrypt:location}/libblkid
configure-options =
--with-bz2-dir=${bzip2:prefix}
--with-zip-dir=${zip:prefix}
--enable-bz2
diff --git a/php-5.3.13/Makefile.global b/php-5.3.13/Makefile.global
index 8dad0e4..707c17d 100644
--- a/php-5.3.13/Makefile.global
+++ b/php-5.3.13/Makefile.global
@@ -10,12 +10,12 @@ all: $(all_targets)
@echo "Build complete."
@echo "Don't forget to run 'make test'."
@echo
-
+
build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
libphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
- -@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) -shrext .so $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@
+ -@$(LIBTOOL) --silent --mode=install install $@ $(phptempdir) >/dev/null 2>&1
libs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
$(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so
@@ -39,8 +39,7 @@ install-modules: build-modules
@test -d modules && \
$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR)
@echo "Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/"
- @rm -f modules/*.la >/dev/null 2>&1
- @$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR)
+ @$(INSTALL) modules/*.$(SHLIB_DL_SUFFIX_NAME) $(INSTALL_ROOT)$(EXTENSION_DIR)
install-headers:
-@if test "$(INSTALL_HEADERS)"; then \
@@ -107,7 +106,7 @@ clean:
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
- find . -name \*.so | xargs rm -f
+ find . -name \*.$(SHLIB_DL_SUFFIX_NAME) | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*
diff --git a/php-5.3.13/acinclude.m4 b/php-5.3.13/acinclude.m4
index 5515b3f..f32378e 100644
--- a/php-5.3.13/acinclude.m4
+++ b/php-5.3.13/acinclude.m4
@@ -844,6 +844,10 @@ AC_DEFUN([PHP_SHARED_MODULE],[
suffix=so
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -Wl,-G -o '$3'/$1.la -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD) && mv -f '$3'/.libs/$1.so '$3'/$1.so'
;;
+ *cygwin*[)]
+ suffix=la
+ link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared -export-dynamic -avoid-version -module -no-undefined -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) ifelse($1, libphp5, , -lphp5) $(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)'
+ ;;
*netware*[)]
suffix=nlm
link_cmd='$(LIBTOOL) --mode=link ifelse($4,,[$(CC)],[$(CXX)]) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o [$]@ -shared -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $($2) ifelse($1, php5lib, , -L$(top_builddir)/netware -lphp5lib) $(translit(ifelse($1, php5lib, $1, m4_substr($1, 3)),a-z_-,A-Z__)_SHARED_LIBADD)'
@@ -1990,6 +1994,10 @@ AC_DEFUN([PHP_SHLIB_SUFFIX_NAMES],[
SHLIB_SUFFIX_NAME=dylib
SHLIB_DL_SUFFIX_NAME=so
;;
+ *cygwin*[)]
+ SHLIB_SUFFIX_NAME=dll.a
+ SHLIB_DL_SUFFIX_NAME=dll
+ ;;
esac
])
diff --git a/php-5.3.13/build/buildcheck.sh b/php-5.3.13/build/buildcheck.sh
index de16264..8d3e3a1 100755
--- a/php-5.3.13/build/buildcheck.sh
+++ b/php-5.3.13/build/buildcheck.sh
@@ -44,7 +44,7 @@ echo " to build PHP from SVN."
exit 1
fi
-if test "$1" = "2" -a "$2" -gt "59"; then
+if false; then
echo "buildconf: You need autoconf 2.59 or lower to build this version of PHP."
echo " You are currently trying to use $ac_version"
echo " Most distros have separate autoconf 2.13 or 2.59 packages."
diff --git a/php-5.3.13/configure.in b/php-5.3.13/configure.in
index f8241e6..9ab6e3a 100644
--- a/php-5.3.13/configure.in
+++ b/php-5.3.13/configure.in
@@ -1,7 +1,7 @@
## $Id$ -*- autoconf -*-
dnl ## Process this file with autoconf to produce a configure script.
-divert(1)
+divert(6001)
dnl ## Diversion 1 is the autoconf + automake setup phase. We also
dnl ## set the PHP version, deal with platform-specific compile
@@ -218,7 +218,13 @@ if test "$GCC" = "yes"; then
;;
esac
if test $GCC_MAJOR_VERSION -ge 4; then
- CFLAGS="$CFLAGS -fvisibility=hidden"
+ case $host_alias in
+ *cygwin*|*mingw*)
+ ;;
+ *)
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ ;;
+ esac
fi
fi
@@ -290,7 +296,7 @@ sinclude(TSRM/threads.m4)
sinclude(TSRM/tsrm.m4)
-divert(2)
+divert(6002)
dnl ## Diversion 2 is where we set PHP-specific options and come up
dnl ## with reasonable default values for them. We check for pthreads here
@@ -329,7 +335,7 @@ if test "$enable_maintainer_zts" = "yes"; then
PTHREADS_FLAGS
fi
-divert(3)
+divert(6003)
dnl ## In diversion 3 we check for compile-time options to the PHP
dnl ## core and how to deal with different system dependencies.
@@ -683,7 +689,7 @@ if test "x$php_crypt_r" = "x1"; then
PHP_CRYPT_R_STYLE
fi
-divert(4)
+divert(6004)
dnl ## In diversion 4 we check user-configurable general settings.
@@ -924,7 +930,7 @@ else
AC_MSG_RESULT([using system default])
fi
-divert(5)
+divert(6005)
dnl ## In diversion 5 we check which extensions should be compiled.
dnl ## All of these are normally in the extension directories.
@@ -982,7 +988,7 @@ case $php_build_target in
standard_libtool_flag='-prefer-non-pic'
;;
esac
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version -module"
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version -module -no-undefined"
;;
esac
@@ -1216,7 +1222,7 @@ case $host_alias in
*)
PHP_UNAME=`uname -a | xargs`
AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
- PHP_OS=`uname | xargs`
+ PHP_OS=`uname | xargs | sed -e 's/[[-_ ]].*//'`
AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
;;
esac
@@ -1343,14 +1349,8 @@ case $host_alias in
;;
esac
-dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX).
-dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler.
-AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
- undefine([AC_PROG_CXX])
- AC_DEFUN([AC_PROG_CXX], [])
- undefine([AC_PROG_CXXCPP])
- AC_DEFUN([AC_PROG_CXXCPP], [php_prog_cxxcpp=disabled])
-])
+AC_PROG_CXX
+AC_PROG_CXXCPP
AC_PROG_LIBTOOL
if test "$enable_debug" != "yes"; then
diff --git a/php-5.3.13/ext/curl/config.m4 b/php-5.3.13/ext/curl/config.m4
index fbb4f5b..66ab614 100644
--- a/php-5.3.13/ext/curl/config.m4
+++ b/php-5.3.13/ext/curl/config.m4
@@ -60,11 +60,14 @@ if test "$PHP_CURL" != "no"; then
AC_DEFINE([HAVE_CURL_SSL], [1], [Have cURL with SSL support])
save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
CFLAGS="`$CURL_CONFIG --cflags`"
+ LIBS="`$CURL_CONFIG --libs`"
AC_PROG_CPP
AC_MSG_CHECKING([for openssl support in libcurl])
AC_TRY_RUN([
+#include <string.h>
#include <curl/curl.h>
int main(int argc, char *argv[])
@@ -92,6 +95,7 @@ int main(int argc, char *argv[])
AC_MSG_CHECKING([for gnutls support in libcurl])
AC_TRY_RUN([
+#include <string.h>
#include <curl/curl.h>
int main(int argc, char *argv[])
@@ -118,6 +122,7 @@ int main(int argc, char *argv[])
])
CFLAGS="$save_CFLAGS"
+ LIBS="$save_LIBS"
else
AC_MSG_RESULT([no])
fi
diff --git a/php-5.3.13/ext/dba/config.m4 b/php-5.3.13/ext/dba/config.m4
index 4269b1c..2418e2a 100644
--- a/php-5.3.13/ext/dba/config.m4
+++ b/php-5.3.13/ext/dba/config.m4
@@ -175,7 +175,7 @@ if test "$PHP_NDBM" != "no"; then
done
if test -n "$THIS_INCLUDE"; then
- for LIB in ndbm db1 c; do
+ for LIB in ndbm db1 gdbm_compat c; do
PHP_CHECK_LIBRARY($LIB, dbm_open, [
AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
AC_DEFINE(DBA_NDBM, 1, [ ])
@@ -483,7 +483,7 @@ if test "$PHP_DBM" != "no"; then
done
if test -n "$THIS_INCLUDE"; then
- for LIB in dbm c gdbm; do
+ for LIB in dbm c gdbm gdbm_compat; do
PHP_CHECK_LIBRARY($LIB, dbminit, [
AC_MSG_CHECKING(for DBM using GDBM)
AC_DEFINE_UNQUOTED(DBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
diff --git a/php-5.3.13/ext/intl/config.m4 b/php-5.3.13/ext/intl/config.m4
index dc235db..5481796 100755
--- a/php-5.3.13/ext/intl/config.m4
+++ b/php-5.3.13/ext/intl/config.m4
@@ -9,6 +9,7 @@ if test "$PHP_INTL" != "no"; then
PHP_SETUP_ICU(INTL_SHARED_LIBADD)
PHP_SUBST(INTL_SHARED_LIBADD)
PHP_REQUIRE_CXX()
+ PHP_ADD_LIBRARY(stdc++, 1, INTL_SHARED_LIBADD)
PHP_NEW_EXTENSION(intl, php_intl.c \
intl_error.c \
diff --git a/php-5.3.13/ext/mssql/config.m4 b/php-5.3.13/ext/mssql/config.m4
index 4231bb3..5764500 100644
--- a/php-5.3.13/ext/mssql/config.m4
+++ b/php-5.3.13/ext/mssql/config.m4
@@ -38,7 +38,7 @@ if test "$PHP_MSSQL" != "no"; then
fi
fi
- if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then
+ if test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.$SHLIB_SUFFIX_NAME"; then
AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.[a|so])
fi
diff --git a/php-5.3.13/ext/pdo_dblib/config.m4 b/php-5.3.13/ext/pdo_dblib/config.m4
index 3410ba9..50a76ca 100644
--- a/php-5.3.13/ext/pdo_dblib/config.m4
+++ b/php-5.3.13/ext/pdo_dblib/config.m4
@@ -46,7 +46,7 @@ if test "$PHP_PDO_DBLIB" != "no"; then
PHP_LIBDIR=lib
fi
- if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then
+ if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.$SHLIB_SUFFIX_NAME"; then
AC_MSG_ERROR(Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.[a|so])
fi
diff --git a/php-5.3.13/ext/pspell/config.m4 b/php-5.3.13/ext/pspell/config.m4
index 67e5b27..175c437 100644
--- a/php-5.3.13/ext/pspell/config.m4
+++ b/php-5.3.13/ext/pspell/config.m4
@@ -29,8 +29,6 @@ if test "$PHP_PSPELL" != "no"; then
PSPELL_LIBDIR=$PSPELL_DIR/$PHP_LIBDIR
- PHP_ADD_LIBRARY_WITH_PATH(pspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD)
-
dnl Add -laspell to LIBS if it exists
PHP_CHECK_LIBRARY(aspell,new_aspell_config,
[
diff --git a/php-5.3.13/ext/readline/config.m4 b/php-5.3.13/ext/readline/config.m4
index a99262a..e757177 100644
--- a/php-5.3.13/ext/readline/config.m4
+++ b/php-5.3.13/ext/readline/config.m4
@@ -53,13 +53,6 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
-L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
])
- PHP_CHECK_LIBRARY(readline, rl_callback_read_char,
- [
- AC_DEFINE(HAVE_RL_CALLBACK_READ_CHAR, 1, [ ])
- ],[],[
- -L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
- ])
-
AC_DEFINE(HAVE_LIBREADLINE, 1, [ ])
elif test "$PHP_LIBEDIT" != "no"; then
@@ -97,7 +90,12 @@ elif test "$PHP_LIBEDIT" != "no"; then
fi
if test "$PHP_READLINE" != "no" || test "$PHP_LIBEDIT" != "no"; then
+ save_LIBS="$LIBS"
+ LIBS="-L$READLINE_DIR/$PHP_LIBDIR $READLINE_SHARED_LIBADD $PHP_READLINE_LIBS"
AC_CHECK_FUNCS([rl_completion_matches])
+ AC_CHECK_FUNCS([rl_callback_read_char])
+ AC_CHECK_FUNCS([rl_on_new_line])
+ LIBS="$save_LIBS"
PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)
PHP_SUBST(READLINE_SHARED_LIBADD)
fi
diff --git a/php-5.3.13/ext/readline/readline.c b/php-5.3.13/ext/readline/readline.c
index 820e4b4..7da0c37 100644
--- a/php-5.3.13/ext/readline/readline.c
+++ b/php-5.3.13/ext/readline/readline.c
@@ -50,13 +50,15 @@ PHP_FUNCTION(readline_list_history);
PHP_FUNCTION(readline_read_history);
PHP_FUNCTION(readline_write_history);
PHP_FUNCTION(readline_completion_function);
+#ifdef HAVE_RL_ON_NEW_LINE
+PHP_FUNCTION(readline_on_new_line);
+#endif
#if HAVE_RL_CALLBACK_READ_CHAR
PHP_FUNCTION(readline_callback_handler_install);
PHP_FUNCTION(readline_callback_read_char);
PHP_FUNCTION(readline_callback_handler_remove);
PHP_FUNCTION(readline_redisplay);
-PHP_FUNCTION(readline_on_new_line);
static zval *_prepped_callback = NULL;
@@ -118,7 +120,9 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_readline_redisplay, 0)
ZEND_END_ARG_INFO()
+#endif
+#ifdef HAVE_RL_ON_NEW_LINE
ZEND_BEGIN_ARG_INFO(arginfo_readline_on_new_line, 0)
ZEND_END_ARG_INFO()
#endif
@@ -141,6 +145,8 @@ static const zend_function_entry php_readline_functions[] = {
PHP_FE(readline_callback_read_char, arginfo_readline_callback_read_char)
PHP_FE(readline_callback_handler_remove, arginfo_readline_callback_handler_remove)
PHP_FE(readline_redisplay, arginfo_readline_redisplay)
+#endif
+#ifdef HAVE_RL_ON_NEW_LINE
PHP_FE(readline_on_new_line, arginfo_readline_on_new_line)
#endif
PHP_FE_END
@@ -611,6 +617,10 @@ PHP_FUNCTION(readline_redisplay)
}
/* }}} */
+#endif
+
+#ifdef HAVE_RL_ON_NEW_LINE
+
/* {{{ proto void readline_on_new_line(void)
Inform readline that the cursor has moved to a new line */
PHP_FUNCTION(readline_on_new_line)
diff --git a/php-5.3.13/ext/standard/config.m4 b/php-5.3.13/ext/standard/config.m4
index e28c351..70b2a82 100644
--- a/php-5.3.13/ext/standard/config.m4
+++ b/php-5.3.13/ext/standard/config.m4
@@ -1,6 +1,6 @@
dnl $Id$ -*- autoconf -*-
-divert(3)dnl
+divert(6003)dnl
dnl
dnl Check if flush should be called explicitly after buffered io
@@ -342,7 +342,7 @@ dnl
AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan mempcpy strpncpy)
AC_FUNC_FNMATCH
-divert(5)dnl
+divert(6005)dnl
dnl
dnl Check if there is a support means of creating a new process
diff --git a/php-5.3.13/sapi/apache/config.m4 b/php-5.3.13/sapi/apache/config.m4
index af83e9b..fbcec33 100644
--- a/php-5.3.13/sapi/apache/config.m4
+++ b/php-5.3.13/sapi/apache/config.m4
@@ -75,6 +75,10 @@ if test "$PHP_APXS" != "no"; then
PHP_AIX_LDFLAGS="-Wl,-brtl"
build_type=shared
;;
+ *cygwin*)
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lhttpd"
+ build_type=shared
+ ;;
*darwin*)
MH_BUNDLE_FLAGS="-dynamic -twolevel_namespace -bundle -bundle_loader $APXS_HTTPD"
PHP_SUBST(MH_BUNDLE_FLAGS)
diff --git a/php-5.3.13/sapi/apache2handler/config.m4 b/php-5.3.13/sapi/apache2handler/config.m4
index 702f91f..c1f791a 100644
--- a/php-5.3.13/sapi/apache2handler/config.m4
+++ b/php-5.3.13/sapi/apache2handler/config.m4
@@ -48,7 +48,9 @@ if test "$PHP_APXS2" != "no"; then
echo $APU_BINDIR/apu-config`
APR_CFLAGS="`$APR_CONFIG --cppflags --includes`"
+ APR_LIBS="`$APR_CONFIG --ldflags --link-ld`"
APU_CFLAGS="`$APU_CONFIG --includes`"
+ APU_LIBS="`$APU_CONFIG --ldflags --link-ld`"
for flag in $APXS_CFLAGS; do
case $flag in
@@ -57,6 +59,7 @@ if test "$PHP_APXS2" != "no"; then
done
APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS"
+ EXTRA_LIBS="$APR_LIBS $APU_LIBS"
# Test that we're trying to configure with apache 2.x
PHP_AP_EXTRACT_VERSION($APXS_HTTPD)
@@ -86,17 +89,12 @@ if test "$PHP_APXS2" != "no"; then
PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
;;
+ *cygwin*)
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L`$APXS -q LIBDIR` -lhttpd2core"
+ PHP_SELECT_SAPI(apache2handler, shared, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
+ INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
+ ;;
*darwin*)
- dnl When using bundles on Darwin, we must resolve all symbols. However,
- dnl the linker does not recursively look at the bundle loader and
- dnl pull in its dependencies. Therefore, we must pull in the APR
- dnl and APR-util libraries.
- if test -x "$APR_CONFIG"; then
- MH_BUNDLE_FLAGS="`$APR_CONFIG --ldflags --link-ld --libs`"
- fi
- if test -x "$APU_CONFIG"; then
- MH_BUNDLE_FLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $MH_BUNDLE_FLAGS"
- fi
MH_BUNDLE_FLAGS="-bundle -bundle_loader $APXS_HTTPD $MH_BUNDLE_FLAGS"
PHP_SUBST(MH_BUNDLE_FLAGS)
PHP_SELECT_SAPI(apache2handler, bundle, mod_php5.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
diff --git a/php-5.3.13/sapi/cli/config.m4 b/php-5.3.13/sapi/cli/config.m4
index 1a6fdbf..856c92d 100644
--- a/php-5.3.13/sapi/cli/config.m4
+++ b/php-5.3.13/sapi/cli/config.m4
@@ -9,7 +9,7 @@ PHP_ARG_ENABLE(cli,,
AC_MSG_CHECKING(for CLI build)
if test "$PHP_CLI" != "no"; then
PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/sapi/cli/Makefile.frag,$abs_srcdir/sapi/cli,sapi/cli)
- SAPI_CLI_PATH=sapi/cli/php
+ SAPI_CLI_PATH=sapi/cli/php$EXEEXT
PHP_SUBST(SAPI_CLI_PATH)
case $host_alias in
diff --git a/php-5.3.13/sapi/fpm/config.m4 b/php-5.3.13/sapi/fpm/config.m4
index 953fa1f..2609399 100644
--- a/php-5.3.13/sapi/fpm/config.m4
+++ b/php-5.3.13/sapi/fpm/config.m4
@@ -585,7 +585,7 @@ if test "$PHP_FPM" != "no"; then
PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.8 sapi/fpm/status.html)
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/fpm/Makefile.frag], [$abs_srcdir/sapi/fpm], [sapi/fpm])
- SAPI_FPM_PATH=sapi/fpm/php-fpm
+ SAPI_FPM_PATH=sapi/fpm/php-fpm$EXEEXT
PHP_SUBST(SAPI_FPM_PATH)
if test "$fpm_trace_type" && test -f "$abs_srcdir/sapi/fpm/fpm/fpm_trace_$fpm_trace_type.c"; then
diff --git a/php-5.3.13/scripts/phpize.m4 b/php-5.3.13/scripts/phpize.m4
index e3a30a5..373039d 100644
--- a/php-5.3.13/scripts/phpize.m4
+++ b/php-5.3.13/scripts/phpize.m4
@@ -1,6 +1,6 @@
dnl This file becomes configure.in for self-contained extensions.
-divert(1)
+divert(6001)
AC_PREREQ(2.13)
AC_INIT(config.m4)
......@@ -18,7 +18,7 @@ recipe = hexagonit.recipe.download
version = 1.4.6
url = http://mir2.ovh.net/ftp.apache.org/dist/apr/apr-${:version}.tar.bz2
md5sum = ffee70a111fd07372982b0550bbb14b7
[apr-util]
recipe = hexagonit.recipe.download
version = 1.4.1
......@@ -27,162 +27,95 @@ md5sum = 52b31b33fb1aa16e65ddaefc76e41151
[apache]
# inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/
recipe = hexagonit.recipe.cmmi
depends =
${gdbm:version}
recipe = slapos.recipe.cmmi
dependencies = gdbm libexpat libuuid openssl pcre pkgconfig sqlite3 zlib
version = 2.4.3
revision = 1
url = http://mir2.ovh.net/ftp.apache.org/dist/httpd/httpd-${:version}.tar.bz2
md5sum = 87aaf7bc7e8715f0455997bb8c6791aa
configure-command = cp -ar ${apr:location}/apr-${apr:version} srclib/apr/; cp -ar ${apr-util:location}/apr-util-${apr-util:version} srclib/apr-util; ./configure
configure-options = --prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--disable-static
--enable-authn-alias
--enable-bucketeer
--enable-cache
--enable-case-filter
--enable-case-filter-in
--enable-cgid
--enable-charset-lite
--enable-disk-cache
--enable-mem-cache
--enable-echo
--enable-exception-hook
--enable-mods-shared=all
--enable-optional-fn-export
--enable-optional-fn-import
--enable-optional-hook-export
--enable-optional-hook-import
--enable-proxy
--enable-proxy-ajp
--enable-proxy-balancer
--enable-proxy-connect
--enable-proxy-ftp
--enable-proxy-http
--enable-proxy-scgi
--enable-dav
--enable-dav-fs
--enable-so
--enable-ssl
--disable-lua
--with-included-apr
--with-ssl=${openssl:location}
--with-z=${zlib:location}
--with-expat=${libexpat:location}
--with-pcre=${pcre:location}
--with-sqlite3=${sqlite3:location}
--with-gdbm=${gdbm:location}
--without-lber
--without-ldap
--without-ndbm
--without-berkeley-db
--without-pgsql
--without-mysql
--without-sqlite2
--without-oracle
--without-freedts
--without-odbc
--without-iconv
environment =
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
CPPFLAGS =-I${libuuid:location}/include
LDFLAGS =-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -Wl,-rpath=${libexpat:location}/lib -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${gdbm:location}/lib
[mod_antiloris-apache-2.4.patch]
# http://www.apachelounge.com/viewtopic.php?p=19139
# http://www.apachelounge.com/viewtopic.php?p=20551
pre-configure = cp -ar ${apr:location}/apr-${apr:version} srclib/apr; cp -ar ${apr-util:location}/apr-util-${apr-util:version} srclib/apr-util
configure-options =
--disable-static
--enable-authn-alias
--enable-bucketeer
--enable-cache
--enable-case-filter
--enable-case-filter-in
--enable-cgid
--enable-charset-lite
--enable-disk-cache
--enable-mem-cache
--enable-echo
--enable-exception-hook
--enable-mods-shared=all
--enable-optional-fn-export
--enable-optional-fn-import
--enable-optional-hook-export
--enable-optional-hook-import
--enable-proxy
--enable-proxy-ajp
--enable-proxy-balancer
--enable-proxy-connect
--enable-proxy-ftp
--enable-proxy-http
--enable-proxy-scgi
--enable-dav
--enable-dav-fs
--enable-so
--enable-ssl
--disable-lua
--with-included-apr
--without-lber
--without-ldap
--without-ndbm
--without-berkeley-db
--without-pgsql
--without-mysql
--without-sqlite2
--without-oracle
--without-freedts
--without-odbc
--without-iconv
--with-ssl=${openssl:prefix}
--with-z=${zlib:prefix}
--with-expat=${libexpat:prefix}
--with-pcre=${pcre:prefix}
--with-sqlite3=${sqlite3:prefix}
--with-gdbm=${gdbm:prefix}
[apr-patches]
recipe = hexagonit.recipe.download
url =${:_profile_base_location_}/${:filename}
filename = mod_antiloris-apache-2.4.patch
download-only = true
md5sum = 4f074f035d3b37f3f3e71cd9616440f3
url = ${:_profile_base_location_}/cygwin-apr-patches.tar.gz
md5sum = b6a537dc01775fca8438c4434d23798a
[apache-antiloris]
# Note: Shall react on each build of apache and reinstall itself
recipe = hexagonit.recipe.cmmi
url = http://sourceforge.net/projects/mod-antiloris/files/mod_antiloris-0.4.tar.bz2/download
md5sum = 66862bf10e9be3a023e475604a28a0b4
patch-options = -p0
patches =
${mod_antiloris-apache-2.4.patch:location}/${mod_antiloris-apache-2.4.patch:filename}
depends =
${apache:version}
${apache:revision}
${mod_antiloris-apache-2.4.patch:md5sum}
configure-command = ${apache:location}/bin/apxs
configure-options = -c mod_antiloris.c
make-binary = ${:configure-command}
make-options = -i -a -n antiloris mod_antiloris.la
make-targets =
[x86-cygwin-apache]
# Patch apr and apr-util after copied to srclib
dependencies = ${apache:dependencies} apr-patches
pre-configure = ${apache:pre-configure}; (cd srclib/apr; patch -p2 < ${apr-patches:location}/cygwin-apr-1.4.6.patch; cd ../apr-util; patch -p2 < ${apr-patches:location}/cygwin-apr-util-1.4.1.patch); true
[apache-2.2]
# inspired on http://old.aclark.net/team/aclark/blog/a-lamp-buildout-for-wordpress-and-other-php-apps/
recipe = hexagonit.recipe.cmmi
url = http://mir2.ovh.net/ftp.apache.org/dist//httpd/httpd-2.2.22.tar.gz
md5sum = d77fa5af23df96a8af68ea8114fa6ce1
patch-options = -p1
configure-options = --disable-static
--enable-authn-alias
--enable-bucketeer
--enable-cache
--enable-case-filter
--enable-case-filter-in
--enable-cgid
--enable-charset-lite
--enable-disk-cache
--enable-mem-cache
--enable-echo
--enable-exception-hook
--enable-mods-shared=all
--enable-optional-fn-export
--enable-optional-fn-import
--enable-optional-hook-export
--enable-optional-hook-import
--enable-proxy
--enable-proxy-ajp
--enable-proxy-balancer
--enable-proxy-connect
--enable-proxy-ftp
--enable-proxy-http
--enable-proxy-scgi
--enable-dav
--enable-dav-fs
--enable-so
--enable-ssl
--with-included-apr
--with-ssl=${openssl:location}
--with-z=${zlib:location}
--with-expat=${libexpat:location}
--with-pcre=${pcre:location}
--with-sqlite3=${sqlite3:location}
--with-gdbm=${gdbm:location}
--without-lber
--without-ldap
--without-ndbm
--without-berkeley-db
--without-pgsql
--without-mysql
--without-sqlite2
--without-oracle
--without-freedts
--without-odbc
--without-iconv
patches =
${:_profile_base_location_}/cygwin-httpd-2.4.3-no-undefined.patch
${:_profile_base_location_}/cygwin-httpd-2.4.3-src.patch
environment =
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
CPPFLAGS =-I${libuuid:location}/include
LDFLAGS =-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${openssl:location}/lib -L${libuuid:location}/lib -Wl,-rpath=${libuuid:location}/lib -Wl,-rpath=${libexpat:location}/lib -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${gdbm:location}/lib
# Need rebase moduels in the cygwin, and because cygwin is running,
# some cygwin dlls can't be rebase, ignore this error.
# post-install = (cd %(prefix)s/modules; for i in *.so ; do rebase -q -s -d $i 2>/dev/null; done); true
[apache-antiloris-apache-2.2]
[apache-antiloris]
# Note: Shall react on each build of apache and reinstall itself
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies = apache
url = http://sourceforge.net/projects/mod-antiloris/files/mod_antiloris-0.4.tar.bz2/download
md5sum = 66862bf10e9be3a023e475604a28a0b4
configure-command = ${apache-2.2:location}/bin/apxs
configure-command = ${apache:prefix}/bin/apxs
configure-options = -c mod_antiloris.c
make-binary = ${:configure-command}
make-options = -i -a -n antiloris mod_antiloris.la
make-targets =
patch-options = -p0
patches =
${:_profile_base_location_}/mod_antiloris-apache-2.4.patch#4f074f035d3b37f3f3e71cd9616440f3
[x86-cygwin-apache-antiloris]
environment =
LDFLAGS =-no-undefined
diff --git a/apr-1.4.6/build/libtool.m4 b/apr-1.4.6/build/libtool.m4
index 422bd72..410ceb5 100644
--- a/apr-1.4.6/build/libtool.m4
+++ b/apr-1.4.6/build/libtool.m4
@@ -1,8 +1,8 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@@ -11,8 +11,8 @@
m4_define([_LT_COPYING], [dnl
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
@@ -146,8 +146,6 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
-dnl
_LT_DECL([], [host_alias], [0], [The host system])dnl
_LT_DECL([], [host], [0])dnl
_LT_DECL([], [host_os], [0])dnl
@@ -639,7 +637,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.
-Copyright (C) 2011 Free Software Foundation, Inc.
+Copyright (C) 2010 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
gives unlimited permision to copy, distribute and modify it."
@@ -803,7 +801,6 @@ AC_DEFUN([LT_LANG],
m4_case([$1],
[C], [_LT_LANG(C)],
[C++], [_LT_LANG(CXX)],
- [Go], [_LT_LANG(GO)],
[Java], [_LT_LANG(GCJ)],
[Fortran 77], [_LT_LANG(F77)],
[Fortran], [_LT_LANG(FC)],
@@ -825,31 +822,6 @@ m4_defun([_LT_LANG],
])# _LT_LANG
-m4_ifndef([AC_PROG_GO], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_GO. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-m4_defun([AC_PROG_GO],
-[AC_LANG_PUSH(Go)dnl
-AC_ARG_VAR([GOC], [Go compiler command])dnl
-AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
-_AC_ARG_VAR_LDFLAGS()dnl
-AC_CHECK_TOOL(GOC, gccgo)
-if test -z "$GOC"; then
- if test -n "$ac_tool_prefix"; then
- AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
- fi
-fi
-if test -z "$GOC"; then
- AC_CHECK_PROG(GOC, gccgo, gccgo, false)
-fi
-])#m4_defun
-])#m4_ifndef
-
-
# _LT_LANG_DEFAULT_CONFIG
# -----------------------
m4_defun([_LT_LANG_DEFAULT_CONFIG],
@@ -880,10 +852,6 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
m4_ifdef([LT_PROG_GCJ],
[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-AC_PROVIDE_IFELSE([AC_PROG_GO],
- [LT_LANG(GO)],
- [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
-
AC_PROVIDE_IFELSE([LT_PROG_RC],
[LT_LANG(RC)],
[m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
@@ -986,13 +954,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
_lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1000,7 +962,6 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
rm -rf libconftest.dylib*
rm -f conftest.*
fi])
-
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
[lt_cv_ld_exported_symbols_list],
[lt_cv_ld_exported_symbols_list=no
@@ -1012,7 +973,6 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
[lt_cv_ld_exported_symbols_list=no])
LDFLAGS="$save_LDFLAGS"
])
-
AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
[lt_cv_ld_force_load=no
cat > conftest.c << _LT_EOF
@@ -1030,9 +990,7 @@ _LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
_lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&AS_MESSAGE_LOG_FD
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1077,8 +1035,8 @@ _LT_EOF
])
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
# Checks for linker and compiler features on darwin
m4_defun([_LT_DARWIN_LINKER_FEATURES],
[
@@ -1089,8 +1047,6 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
if test "$lt_cv_ld_force_load" = "yes"; then
_LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
- m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
- [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
fi
@@ -1374,27 +1330,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
CFLAGS="$SAVE_CFLAGS"
fi
;;
-*-*solaris*)
+sparc*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
- fi
- ;;
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
@@ -1471,13 +1414,13 @@ old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
;;
*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
;;
esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
case $host_os in
@@ -1657,11 +1600,6 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=196608
;;
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -2247,7 +2185,7 @@ need_version=unknown
case $host_os in
aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
shlibpath_var=LIBPATH
@@ -2256,7 +2194,7 @@ aix3*)
;;
aix[[4-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
@@ -2321,7 +2259,7 @@ beos*)
;;
bsdi[[45]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -2460,7 +2398,7 @@ m4_if([$1], [],[
;;
dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -2468,6 +2406,10 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -2475,7 +2417,7 @@ freebsd* | dragonfly*)
objformat=`/usr/bin/objformat`
else
case $host_os in
- freebsd[[23]].*) objformat=aout ;;
+ freebsd[[123]]*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
@@ -2493,7 +2435,7 @@ freebsd* | dragonfly*)
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
- freebsd2.*)
+ freebsd2*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[[01]]* | freebsdelf3.[[01]]*)
@@ -2513,18 +2455,17 @@ freebsd* | dragonfly*)
;;
gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
@@ -2585,7 +2526,7 @@ hpux9* | hpux10* | hpux11*)
;;
interix[[3-9]]*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -2601,7 +2542,7 @@ irix5* | irix6* | nonstopux*)
nonstopux*) version_type=nonstopux ;;
*)
if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
else
version_type=irix
fi ;;
@@ -2638,9 +2579,9 @@ linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
-# This must be glibc/ELF.
+# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2703,7 +2644,7 @@ netbsd*)
;;
newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
@@ -2772,7 +2713,7 @@ rdos*)
;;
solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2797,7 +2738,7 @@ sunos4*)
;;
sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -2821,7 +2762,7 @@ sysv4 | sysv4.3*)
sysv4*MP*)
if test -d /usr/nec ;then
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
soname_spec='$libname${shared_ext}.$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -2852,7 +2793,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2862,7 +2803,7 @@ tpf*)
;;
uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -3284,7 +3225,7 @@ irix5* | irix6* | nonstopux*)
lt_cv_deplibs_check_method=pass_all
;;
-# This must be glibc/ELF.
+# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3704,7 +3645,6 @@ for ac_symprfx in "" "_"; do
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -4289,9 +4229,7 @@ m4_if([$1], [CXX], [
case $cc_basename in
nvcc*) # Cuda Compiler Driver 2.2
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
- if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
- fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
;;
esac
else
@@ -4383,33 +4321,18 @@ m4_if([$1], [CXX], [
;;
*)
case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ *Sun\ F* | *Sun*Fortran*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)=''
;;
- *Sun\ F* | *Sun*Fortran*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
*Sun\ C*)
# Sun C 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
;;
- *Intel*\ [[CF]]*Compiler*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- *Portland\ Group*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
esac
;;
esac
@@ -4569,9 +4492,7 @@ m4_if([$1], [CXX], [
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
- cl*)
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- ;;
+ cl*) ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
@@ -4596,6 +4517,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -4846,7 +4768,8 @@ _LT_EOF
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
@@ -5141,7 +5064,6 @@ _LT_EOF
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
# Don't use ranlib
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
@@ -5188,6 +5110,10 @@ _LT_EOF
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
@@ -5200,7 +5126,7 @@ _LT_EOF
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
+ freebsd2*)
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -5239,6 +5165,7 @@ _LT_EOF
fi
if test "$with_gnu_ld" = no; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
@@ -5680,6 +5607,9 @@ _LT_TAGDECL([], [no_undefined_flag], [1],
_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
[Flag to hardcode $libdir into a binary during linking.
This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
_LT_TAGDECL([], [hardcode_libdir_separator], [1],
[Whether we need a single "-rpath" flag with a separated argument])
_LT_TAGDECL([], [hardcode_direct], [0],
@@ -5837,6 +5767,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -6206,7 +6137,7 @@ if test "$_lt_caught_CXX_error" != yes; then
esac
;;
- freebsd2.*)
+ freebsd[[12]]*)
# C++ shared libraries reported to be fairly broken before
# switch to ELF
_LT_TAGVAR(ld_shlibs, $1)=no
@@ -6967,18 +6898,12 @@ public class foo {
}
};
_LT_EOF
-], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
-package foo
-func foo() {
-}
-_LT_EOF
])
_lt_libdeps_save_CFLAGS=$CFLAGS
case "$CC $CFLAGS " in #(
*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
esac
dnl Parse the compiler output and extract the necessary
@@ -7175,6 +7100,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=no
@@ -7307,6 +7233,7 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=no
@@ -7493,77 +7420,6 @@ CFLAGS=$lt_save_CFLAGS
])# _LT_LANG_GCJ_CONFIG
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GO_CONFIG],
-[AC_REQUIRE([LT_PROG_GO])dnl
-AC_LANG_SAVE
-
-# Source file extension for Go test sources.
-ac_ext=go
-
-# Object file extension for compiled Go test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="package main; func main() { }"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='package main; func main() { }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GOC-"gccgo"}
-CFLAGS=$GOFLAGS
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# Go did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
-])# _LT_LANG_GO_CONFIG
-
-
# _LT_LANG_RC_CONFIG([TAG])
# -------------------------
# Ensure that the configuration variables for the Windows resource compiler
@@ -7633,13 +7489,6 @@ dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-# LT_PROG_GO
-# ----------
-AC_DEFUN([LT_PROG_GO],
-[AC_CHECK_TOOL(GOC, gccgo,)
-])
-
-
# LT_PROG_RC
# ----------
AC_DEFUN([LT_PROG_RC],
diff --git a/apr-1.4.6/build/ltmain.sh b/apr-1.4.6/build/ltmain.sh
index 63ae69d..fcebbcb 100644
--- a/apr-1.4.6/build/ltmain.sh
+++ b/apr-1.4.6/build/ltmain.sh
@@ -1,9 +1,9 @@
-# libtool (GNU libtool) 2.4.2
+# libtool (GNU libtool) 2.4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -41,7 +41,6 @@
# --quiet, --silent don't print informational messages
# --no-quiet, --no-silent
# print informational messages (default)
-# --no-warn don't display warning messages
# --tag=TAG use configuration variables from tag TAG
# -v, --verbose print more informational messages than default
# --no-verbose don't print the extra informational messages
@@ -70,7 +69,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2
+# $progname: (GNU libtool) 2.4
# automake: $automake_version
# autoconf: $autoconf_version
#
@@ -80,9 +79,9 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.4.2
+VERSION=2.4
TIMESTAMP=""
-package_revision=1.3337
+package_revision=1.3294
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -137,10 +136,15 @@ progpath="$0"
: ${CP="cp -f"}
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${EGREP="/usr/bin/grep -E"}
+: ${FGREP="/usr/bin/grep -F"}
+: ${GREP="/usr/bin/grep"}
+: ${LN_S="ln -s"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
+: ${SED="/usr/bin/sed"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}
@@ -383,7 +387,7 @@ case $progpath in
;;
*)
save_IFS="$IFS"
- IFS=${PATH_SEPARATOR-:}
+ IFS=:
for progdir in $PATH; do
IFS="$save_IFS"
test -x "$progdir/$progname" && break
@@ -767,8 +771,8 @@ func_help ()
s*\$LTCFLAGS*'"$LTCFLAGS"'*
s*\$LD*'"$LD"'*
s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
p
d
}
@@ -1048,7 +1052,6 @@ opt_finish=false
opt_help=false
opt_help_all=false
opt_silent=:
-opt_warning=:
opt_verbose=:
opt_silent=false
opt_verbose=false
@@ -1117,10 +1120,6 @@ esac
opt_silent=false
func_append preserve_args " $opt"
;;
- --no-warning|--no-warn)
- opt_warning=false
-func_append preserve_args " $opt"
- ;;
--no-verbose)
opt_verbose=false
func_append preserve_args " $opt"
@@ -2060,7 +2059,7 @@ func_mode_compile ()
*.[cCFSifmso] | \
*.ada | *.adb | *.ads | *.asm | \
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
func_xform "$libobj"
libobj=$func_xform_result
;;
@@ -3202,13 +3201,11 @@ func_mode_install ()
# Set up the ranlib parameters.
oldlib="$destdir/$name"
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
if test -n "$stripme" && test -n "$old_striplib"; then
- func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
fi
# Do each command in the postinstall commands.
@@ -3473,7 +3470,7 @@ static const void *lt_preloaded_setup() {
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
*-*-hpux*)
pic_flag_for_symtable=" $pic_flag" ;;
@@ -3985,17 +3982,14 @@ func_exec_program_core ()
# launches target application with the remaining arguments.
func_exec_program ()
{
- case \" \$* \" in
- *\\ --lt-*)
- for lt_wr_arg
- do
- case \$lt_wr_arg in
- --lt-*) ;;
- *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
- esac
- shift
- done ;;
- esac
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done
func_exec_program_core \${1+\"\$@\"}
}
@@ -5063,21 +5057,50 @@ void lt_dump_script (FILE* f)
{
EOF
func_emit_wrapper yes |
- $SED -n -e '
-s/^\(.\{79\}\)\(..*\)/\1\
-\2/
-h
-s/\([\\"]\)/\\\1/g
-s/$/\\n/
-s/\([^\n]*\).*/ fputs ("\1", f);/p
-g
-D'
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
+
cat <<"EOF"
}
EOF
}
# end: func_emit_cwrapperexe_src
+# func_emit_exe_manifest
+# emit a Win32 UAC manifest for executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_exe_manifest ()
+{
+ cat <<EOF
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity version="1.0.0.0"
+EOF
+
+ case $host in
+ i?86-*-* ) echo ' processorArchitecture="x86"' ;;
+ ia64-*-* ) echo ' processorArchitecture="ia64"' ;;
+ x86_64-*-* ) echo ' processorArchitecture="amd64"' ;;
+ *) echo ' processorArchitecture="*"' ;;
+ esac
+
+ cat <<EOF
+ name="$host_os.$PROGRAM.$outputname"
+ type="win32"/>
+
+ <!-- Identify the application security requirements. -->
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
+EOF
+}
+
# func_win32_import_lib_p ARG
# True if ARG is an import lib, as indicated by $file_magic_cmd
func_win32_import_lib_p ()
@@ -5655,8 +5678,7 @@ func_mode_link ()
continue
;;
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -5851,9 +5873,14 @@ func_mode_link ()
# -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support
# -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -{shared,static}-libgcc, -static-{libgfortran|libstdc++}
+ # link against specified runtime library
+ # -fstack-protector* stack protector flags for GCC
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin| \
+ -shared-libgcc|-static-libgcc|-static-libgfortran|-static-libstdc++| \
+ -fstack-protector*)
func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
func_append compile_command " $arg"
@@ -6160,8 +6187,7 @@ func_mode_link ()
lib=
found=no
case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
- |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -6845,7 +6871,7 @@ func_mode_link ()
test "$hardcode_direct_absolute" = no; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$absdir"
+ add_dir="-L$dir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -7330,7 +7356,6 @@ func_mode_link ()
# which has an extra 1 added just for fun
#
case $version_type in
- # correct linux to gnu/linux during the next big refactor
darwin|linux|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
@@ -7447,7 +7472,7 @@ func_mode_link ()
versuffix="$major.$revision"
;;
- linux) # correct to gnu/linux during the next big refactor
+ linux)
func_arith $current - $age
major=.$func_arith_result
versuffix="$major.$age.$revision"
@@ -8035,11 +8060,6 @@ EOF
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
- # Remove ${wl} instances when linking with ld.
- # FIXME: should test the right _cmds variable.
- case $archive_cmds in
- *\$LD\ *) wl= ;;
- esac
if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths
hardcode_libdirs=
@@ -8070,7 +8090,7 @@ EOF
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) func_append perm_rpath " $libdir" ;;
+ *) func_apped perm_rpath " $libdir" ;;
esac
fi
done
@@ -8078,7 +8098,11 @@ EOF
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
- eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
@@ -9042,7 +9066,7 @@ EOF
cwrappersource="$output_path/$objdir/lt-$output_name.c"
cwrapper="$output_path/$output_name.exe"
$RM $cwrappersource $cwrapper
- trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+ trap "$RM $cwrappersource $cwrapper $cwrapper.manifest; exit $EXIT_FAILURE" 1 2 15
func_emit_cwrapperexe_src > $cwrappersource
@@ -9062,6 +9086,16 @@ EOF
$opt_dry_run || {
# note: this script will not be executed, so do not chmod.
if test "x$build" = "x$host" ; then
+ # Create the UAC manifests first if necessary (but the
+ # manifest files must have executable permission regardless).
+ case $output_name in
+ *instal*|*patch*|*setup*|*update*)
+ func_emit_exe_manifest > $cwrapper.manifest
+ func_emit_exe_manifest > $output_path/$objdir/$output_name.exe.manifest
+ chmod +x $cwrapper.manifest
+ chmod +x $output_path/$objdir/$output_name.exe.manifest
+ ;;
+ esac
$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
else
func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -9168,8 +9202,6 @@ EOF
esac
done
fi
- func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
- tool_oldlib=$func_to_tool_file_result
eval cmds=\"$old_archive_cmds\"
func_len " $cmds"
@@ -9279,8 +9311,7 @@ EOF
*.la)
func_basename "$deplib"
name="$func_basename_result"
- func_resolve_sysroot "$deplib"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
test -z "$libdir" && \
func_fatal_error "\`$deplib' is not a valid libtool archive"
func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
@@ -9585,8 +9616,9 @@ func_mode_uninstall ()
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ func_append rmfiles " ${name}.manifest $objdir/${name}.manifest"
if test "$fast_install" = yes && test -n "$relink_command"; then
- func_append rmfiles " $odir/lt-$name"
+ func_append rmfiles " $odir/lt-$name $objdir/lt-${name}.manifest"
fi
if test "X$noexename" != "X$name" ; then
func_append rmfiles " $odir/lt-${noexename}.c"
diff --git a/apr-1.4.6/build/ltoptions.m4 b/apr-1.4.6/build/ltoptions.m4
index 5d9acd8..17cfd51 100644
--- a/apr-1.4.6/build/ltoptions.m4
+++ b/apr-1.4.6/build/ltoptions.m4
@@ -326,24 +326,9 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [AS_HELP_STRING([--with-pic],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
+ [pic_mode="$withval"],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
diff --git a/apr-1.4.6/build/ltversion.m4 b/apr-1.4.6/build/ltversion.m4
index 07a8602..9bf776f 100644
--- a/apr-1.4.6/build/ltversion.m4
+++ b/apr-1.4.6/build/ltversion.m4
@@ -9,15 +9,15 @@
# @configure_input@
-# serial 3337 ltversion.m4
+# serial 3294 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
+m4_define([LT_PACKAGE_VERSION], [2.4])
+m4_define([LT_PACKAGE_REVISION], [1.3294])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
+[macro_version='2.4'
+macro_revision='1.3294'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
diff --git a/apr-1.4.6/configure b/apr-1.4.6/configure
index cee0f0e..95643ad 100755
--- a/apr-1.4.6/configure
+++ b/apr-1.4.6/configure
@@ -1553,7 +1553,7 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ --with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot=DIR Search for dependent libraries within DIR
@@ -2600,7 +2600,7 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
done
@@ -2878,8 +2878,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@@ -3192,17 +3192,6 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# _LT_LANG
-
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_GO. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-#m4_defun
-#m4_ifndef
-
-
# _LT_LANG_DEFAULT_CONFIG
# -----------------------
# _LT_LANG_DEFAULT_CONFIG
@@ -3328,8 +3317,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-# _LT_DARWIN_LINKER_FEATURES([TAG])
-# ---------------------------------
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
# Checks for linker and compiler features on darwin
@@ -3801,14 +3790,6 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# _LT_LANG_GCJ_CONFIG
-# _LT_LANG_GO_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Go compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-# _LT_LANG_GO_CONFIG
-
-
# _LT_LANG_RC_CONFIG([TAG])
# -------------------------
# Ensure that the configuration variables for the Windows resource compiler
@@ -3843,11 +3824,6 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-# LT_PROG_GO
-# ----------
-
-
-
# LT_PROG_RC
# ----------
@@ -4381,7 +4357,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# @configure_input@
-# serial 3337 ltversion.m4
+# serial 3294 ltversion.m4
# This file is part of GNU Libtool
@@ -4595,7 +4571,7 @@ fi
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
@@ -4628,7 +4604,7 @@ fi
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
@@ -4661,7 +4637,7 @@ fi
$as_echo "$ac_cv_target" >&6; }
case $ac_cv_target in
*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;;
esac
target=$ac_cv_target
ac_save_IFS=$IFS; IFS='-'
@@ -4948,7 +4924,7 @@ do
eval ac_val=$`echo $ac_var`
case $ac_val in
[\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) as_fn_error $? "expected an absolute path for --$ac_var: $ac_val" "$LINENO" 5;;
+ *) as_fn_error $? "expected an absolute path for --$ac_var: $ac_val" "$LINENO" 5 ;;
esac
done
@@ -5348,7 +5324,7 @@ fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -5463,7 +5439,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
@@ -5506,7 +5482,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -5565,7 +5541,7 @@ $as_echo "$ac_try_echo"; } >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
fi
fi
@@ -5617,7 +5593,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
@@ -9485,7 +9461,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
fi
ac_ext=c
@@ -10711,8 +10687,8 @@ esac
-macro_version='2.4.2'
-macro_revision='1.3337'
+macro_version='2.4'
+macro_revision='1.3294'
@@ -11345,11 +11321,6 @@ else
lt_cv_sys_max_cmd_len=196608
;;
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -11815,7 +11786,7 @@ irix5* | irix6* | nonstopux*)
lt_cv_deplibs_check_method=pass_all
;;
-# This must be glibc/ELF.
+# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -12452,13 +12423,13 @@ old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
;;
*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
;;
esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
case $host_os in
@@ -12605,7 +12576,6 @@ for ac_symprfx in "" "_"; do
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -12994,7 +12964,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
CFLAGS="$SAVE_CFLAGS"
fi
;;
-*-*solaris*)
+sparc*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
@@ -13005,20 +12975,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
- fi
- ;;
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
@@ -13658,13 +13615,7 @@ else
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
_lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&5
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&5
@@ -13675,7 +13626,6 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
if ${lt_cv_ld_exported_symbols_list+:} false; then :
@@ -13708,7 +13658,6 @@ rm -f core conftest.err conftest.$ac_objext \
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
$as_echo_n "checking for -force_load linker flag... " >&6; }
if ${lt_cv_ld_force_load+:} false; then :
@@ -13730,9 +13679,7 @@ _LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
_lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&5
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&5
@@ -13868,22 +13815,7 @@ fi
# Check whether --with-pic was given.
if test "${with_pic+set}" = set; then :
- withval=$with_pic; lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
+ withval=$with_pic; pic_mode="$withval"
else
pic_mode=default
fi
@@ -13961,10 +13893,6 @@ LIBTOOL='$(SHELL) $(apr_builddir)/libtool'
-
-
-
-
test -z "$LN_S" && LN_S="ln -s"
@@ -14424,9 +14352,7 @@ lt_prog_compiler_static=
case $cc_basename in
nvcc*) # Cuda Compiler Driver 2.2
lt_prog_compiler_wl='-Xlinker '
- if test -n "$lt_prog_compiler_pic"; then
- lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
- fi
+ lt_prog_compiler_pic='-Xcompiler -fPIC'
;;
esac
else
@@ -14517,33 +14443,18 @@ lt_prog_compiler_static=
;;
*)
case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ *Sun\ F* | *Sun*Fortran*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl=''
;;
- *Sun\ F* | *Sun*Fortran*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Qoption ld '
- ;;
*Sun\ C*)
# Sun C 5.9
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl='-Wl,'
;;
- *Intel*\ [CF]*Compiler*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- *Portland\ Group*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
esac
;;
esac
@@ -14905,6 +14816,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
hardcode_direct=no
hardcode_direct_absolute=no
hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
hardcode_libdir_separator=
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
@@ -15154,7 +15066,8 @@ _LT_EOF
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
@@ -15533,7 +15446,6 @@ fi
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
enable_shared_with_static_runtimes=yes
- exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
# Don't use ranlib
old_postinstall_cmds='chmod 644 $oldlib'
@@ -15579,7 +15491,6 @@ fi
hardcode_shlibpath_var=unsupported
if test "$lt_cv_ld_force_load" = "yes"; then
whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
else
whole_archive_flag_spec=''
fi
@@ -15608,6 +15519,10 @@ fi
hardcode_shlibpath_var=no
;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
@@ -15620,7 +15535,7 @@ fi
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
+ freebsd2*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_minus_L=yes
@@ -15659,6 +15574,7 @@ fi
fi
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
hardcode_direct_absolute=yes
@@ -16282,6 +16198,11 @@ esac
+
+
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
$as_echo_n "checking dynamic linker characteristics... " >&6; }
@@ -16371,7 +16292,7 @@ need_version=unknown
case $host_os in
aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
shlibpath_var=LIBPATH
@@ -16380,7 +16301,7 @@ aix3*)
;;
aix[4-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
@@ -16445,7 +16366,7 @@ beos*)
;;
bsdi[45]*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -16584,7 +16505,7 @@ darwin* | rhapsody*)
;;
dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -16592,6 +16513,10 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -16599,7 +16524,7 @@ freebsd* | dragonfly*)
objformat=`/usr/bin/objformat`
else
case $host_os in
- freebsd[23].*) objformat=aout ;;
+ freebsd[123]*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
@@ -16617,7 +16542,7 @@ freebsd* | dragonfly*)
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
- freebsd2.*)
+ freebsd2*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[01]* | freebsdelf3.[01]*)
@@ -16637,18 +16562,17 @@ freebsd* | dragonfly*)
;;
gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
@@ -16709,7 +16633,7 @@ hpux9* | hpux10* | hpux11*)
;;
interix[3-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -16725,7 +16649,7 @@ irix5* | irix6* | nonstopux*)
nonstopux*) version_type=nonstopux ;;
*)
if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
else
version_type=irix
fi ;;
@@ -16762,9 +16686,9 @@ linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
-# This must be glibc/ELF.
+# This must be Linux ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -16846,7 +16770,7 @@ netbsd*)
;;
newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
@@ -16915,7 +16839,7 @@ rdos*)
;;
solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -16940,7 +16864,7 @@ sunos4*)
;;
sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -16964,7 +16888,7 @@ sysv4 | sysv4.3*)
sysv4*MP*)
if test -d /usr/nec ;then
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
soname_spec='$libname${shared_ext}.$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -16995,7 +16919,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -17005,7 +16929,7 @@ tpf*)
;;
uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
+ version_type=linux
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -17787,8 +17711,6 @@ CC="$lt_save_CC"
-
-
ac_config_commands="$ac_config_commands libtool"
@@ -17828,7 +17750,7 @@ fi
if test "x$use_libtool" = "xyes"; then
lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@'
LT_VERSION="-version-info `$get_version libtool $version_hdr APR`"
- link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@"
+ link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) -no-undefined \$(ALL_LDFLAGS) -o \$@"
so_ext='lo'
lib_target='-rpath $(libdir) $(OBJECTS)'
export_lib_target='-rpath \$(libdir) \$(OBJECTS)'
@@ -18674,7 +18596,7 @@ $as_echo "#define HAVE_BONE_VERSION 1" >>confdefs.h
;;
*cygwin*)
OSDIR="unix"
- enable_threads="no"
+ enable_threads="pthread"
eolstr="\\n"
;;
*hpux10* )
@@ -21991,7 +21913,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (void*)
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_voidp=0
fi
@@ -23135,7 +23057,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (void*)
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_voidp=0
fi
@@ -23175,7 +23097,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (char)
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_char=0
fi
@@ -23208,7 +23130,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (int)
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_int=0
fi
@@ -23241,7 +23163,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (long)
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_long=0
fi
@@ -23274,7 +23196,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (short)
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_short=0
fi
@@ -23307,7 +23229,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (long long)
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
ac_cv_sizeof_long_long=0
fi
@@ -24206,7 +24128,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
;; #(
*)
as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
esac
if test $ac_cv_c_bigendian = yes; then
@@ -24753,7 +24675,7 @@ $as_echo "#define DSO_USE_SHL 1" >>confdefs.h
$as_echo "#define DSO_USE_DYLD 1" >>confdefs.h
;;
other) ;; # Use whatever is in dso/OSDIR
- *) as_fn_error $? "Unknown DSO implementation \"$dsotype\"" "$LINENO" 5;;
+ *) as_fn_error $? "Unknown DSO implementation \"$dsotype\"" "$LINENO" 5 ;;
esac
aprdso="1"
apr_modules="$apr_modules dso"
@@ -25284,7 +25206,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -25339,7 +25261,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -27276,7 +27198,7 @@ else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -29190,7 +29112,6 @@ pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
-PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
@@ -29271,6 +29192,7 @@ with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
@@ -29329,7 +29251,6 @@ DLLTOOL \
OBJDUMP \
SHELL \
ECHO \
-PATH_SEPARATOR \
SED \
GREP \
EGREP \
@@ -29378,6 +29299,7 @@ with_gnu_ld \
allow_undefined_flag \
no_undefined_flag \
hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
hardcode_libdir_separator \
exclude_expsyms \
include_expsyms \
@@ -29481,7 +29403,7 @@ do
"test/internal/Makefile") CONFIG_FILES="$CONFIG_FILES test/internal/Makefile" ;;
"default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
esac
done
@@ -29799,7 +29721,7 @@ do
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
@@ -29827,7 +29749,7 @@ do
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
@@ -29854,7 +29776,7 @@ $as_echo "$as_me: creating $ac_file" >&6;}
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
@@ -30056,8 +29978,8 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+# Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
@@ -30120,9 +30042,6 @@ SHELL=$lt_SHELL
# An echo program that protects backslashes.
ECHO=$lt_ECHO
-# The PATH separator for the build system.
-PATH_SEPARATOR=$lt_PATH_SEPARATOR
-
# The host system.
host_alias=$host_alias
host=$host
@@ -30418,6 +30337,10 @@ no_undefined_flag=$lt_no_undefined_flag
# This must work even if \$libdir does not exist
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
# Whether we need a single "-rpath" flag with a separated argument.
hardcode_libdir_separator=$lt_hardcode_libdir_separator
diff --git a/apr-1.4.6/configure.in b/apr-1.4.6/configure.in
index 655de8d..abc3d68 100644
--- a/apr-1.4.6/configure.in
+++ b/apr-1.4.6/configure.in
@@ -282,7 +282,7 @@ AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the
if test "x$use_libtool" = "xyes"; then
lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@'
LT_VERSION="-version-info `$get_version libtool $version_hdr APR`"
- link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@"
+ link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) -no-undefined \$(ALL_LDFLAGS) -o \$@"
so_ext='lo'
lib_target='-rpath $(libdir) $(OBJECTS)'
export_lib_target='-rpath \$(libdir) \$(OBJECTS)'
@@ -550,7 +550,7 @@ case $host in
;;
*cygwin*)
OSDIR="unix"
- enable_threads="no"
+ enable_threads="pthread"
eolstr="\\n"
;;
*hpux10* )
diff --git a/apr-1.4.6/file_io/unix/copy.c b/apr-1.4.6/file_io/unix/copy.c
index df3a49c..aa2836f 100644
--- a/apr-1.4.6/file_io/unix/copy.c
+++ b/apr-1.4.6/file_io/unix/copy.c
@@ -29,7 +29,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path,
apr_fileperms_t perms;
/* Open source file. */
- status = apr_file_open(&s, from_path, APR_FOPEN_READ, APR_OS_DEFAULT, pool);
+ status = apr_file_open(&s, from_path, APR_FOPEN_READ | APR_FOPEN_BINARY, APR_OS_DEFAULT, pool);
if (status)
return status;
@@ -46,7 +46,7 @@ static apr_status_t apr_file_transfer_contents(const char *from_path,
perms = to_perms;
/* Open dest file. */
- status = apr_file_open(&d, to_path, flags, perms, pool);
+ status = apr_file_open(&d, to_path, flags | APR_FOPEN_BINARY, perms, pool);
if (status) {
apr_file_close(s); /* toss any error */
return status;
diff --git a/apr-1.4.6/test/Makefile.in b/apr-1.4.6/test/Makefile.in
index b371074..af1c38b 100644
--- a/apr-1.4.6/test/Makefile.in
+++ b/apr-1.4.6/test/Makefile.in
@@ -118,16 +118,16 @@ mod_test.lo: $(srcdir)/mod_test.c
$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -prefer-pic -o $@ \
-c $(srcdir)/mod_test.c
-OBJECTS_mod_test = mod_test.lo
+OBJECTS_mod_test = mod_test.lo $(LOCAL_LIBS)
mod_test.la: $(OBJECTS_mod_test)
$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` -module \
- -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
+ -avoid-version -no-undefined $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
$(OBJECTS_mod_test)
OBJECTS_libmod_test = mod_test.lo $(LOCAL_LIBS)
libmod_test.la: $(OBJECTS_libmod_test)
$(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -rpath `pwd` \
- -avoid-version $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
+ -avoid-version -no-undefined $(LT_LDFLAGS) $(ALL_LDFLAGS) -o $@ \
$(OBJECTS_libmod_test) $(ALL_LIBS)
OBJECTS_occhild = occhild.lo $(LOCAL_LIBS)
diff --git a/apr-1.4.6/test/abts_tests.h b/apr-1.4.6/test/abts_tests.h
index 13d8b4e..65a4cbb 100644
--- a/apr-1.4.6/test/abts_tests.h
+++ b/apr-1.4.6/test/abts_tests.h
@@ -50,7 +50,9 @@ const struct testlist {
{testpipe},
{testpoll},
{testpool},
+#ifndef CYGWIN
{testproc},
+#endif
{testprocmutex},
{testrand},
{testsleep},
diff --git a/apr-1.4.6/test/testdso.c b/apr-1.4.6/test/testdso.c
index 0d9f27b..ec81c16 100644
--- a/apr-1.4.6/test/testdso.c
+++ b/apr-1.4.6/test/testdso.c
@@ -35,6 +35,9 @@
# define MOD_NAME "mod_test.so"
#elif defined(WIN32)
# define MOD_NAME TESTBINPATH "mod_test.dll"
+#elif defined(CYGWIN)
+# define MOD_NAME ".libs/mod_test.dll"
+# define LIB_NAME ".libs/cygmod_test.dll"
#elif defined(DARWIN)
# define MOD_NAME ".libs/mod_test.so"
# define LIB_NAME ".libs/libmod_test.dylib"
diff --git a/apr-1.4.6/test/testutil.h b/apr-1.4.6/test/testutil.h
index ee68dfb..d33c2ff 100644
--- a/apr-1.4.6/test/testutil.h
+++ b/apr-1.4.6/test/testutil.h
@@ -25,7 +25,7 @@
* and part of apr, itself
*/
-#ifdef WIN32
+#if defined WIN32 && ! defined CYGWIN
#ifdef BINPATH
#define TESTBINPATH APR_STRINGIFY(BINPATH) "/"
#else
@@ -35,7 +35,7 @@
#define TESTBINPATH "./"
#endif
-#ifdef WIN32
+#if defined WIN32 && ! defined CYGWIN
#define EXTENSION ".exe"
#elif NETWARE
#define EXTENSION ".nlm"
diff --git a/apr-util-1.4.1/Makefile.in b/apr-util-1.4.1/Makefile.in
index 963fead..c9827de 100644
--- a/apr-util-1.4.1/Makefile.in
+++ b/apr-util-1.4.1/Makefile.in
@@ -23,7 +23,7 @@ INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
APU_MODULES = @APU_MODULES@
-LINK_MODULE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(APRUTIL_LDFLAGS) -release $(APRUTIL_MAJOR_VERSION) -module -rpath $(APU_DSO_LIBDIR)
+LINK_MODULE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(APRUTIL_LDFLAGS) -release $(APRUTIL_MAJOR_VERSION) -module -no-undefined -rpath $(APU_DSO_LIBDIR) @abs_builddir@/lib@APRUTIL_LIBNAME@.la $(APRUTIL_LIBS)
APU_DSO_LIBDIR = @APU_DSO_LIBDIR@
LT_VERSION = @APU_LTVERSION@
diff --git a/apr-util-1.4.1/dbd/apr_dbd.c b/apr-util-1.4.1/dbd/apr_dbd.c
index 49553f2..664b441 100644
--- a/apr-util-1.4.1/dbd/apr_dbd.c
+++ b/apr-util-1.4.1/dbd/apr_dbd.c
@@ -184,7 +184,7 @@ APU_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name,
#if defined(NETWARE)
apr_snprintf(modname, sizeof(modname), "dbd%s.nlm", name);
-#elif defined(WIN32)
+#elif defined(WIN32) || defined(CYGWIN)
apr_snprintf(modname, sizeof(modname),
"apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name);
#else
diff --git a/apr-util-1.4.1/dbm/apr_dbm.c b/apr-util-1.4.1/dbm/apr_dbm.c
index 5c506fc..a5beead 100644
--- a/apr-util-1.4.1/dbm/apr_dbm.c
+++ b/apr-util-1.4.1/dbm/apr_dbm.c
@@ -162,7 +162,7 @@ static apr_status_t dbm_open_type(apr_dbm_type_t const* * vtable,
#if defined(NETWARE)
apr_snprintf(modname, sizeof(modname), "dbm%s.nlm", type);
-#elif defined(WIN32)
+#elif defined(WIN32) || defined(CYGWIN)
apr_snprintf(modname, sizeof(modname),
"apr_dbm_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", type);
#else
diff --git a/apr-util-1.4.1/ldap/apr_ldap_stub.c b/apr-util-1.4.1/ldap/apr_ldap_stub.c
index 97c1551..9df76b7 100644
--- a/apr-util-1.4.1/ldap/apr_ldap_stub.c
+++ b/apr-util-1.4.1/ldap/apr_ldap_stub.c
@@ -45,7 +45,7 @@ static apr_status_t load_ldap(apr_pool_t *pool)
return rv;
}
-#if defined(WIN32)
+#if defined(WIN32) || defined(CYGWIN)
modname = "apr_ldap-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll";
#else
modname = "apr_ldap-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so";
diff --git a/Makefile.in b/Makefile.in
index e548e99..c019753 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -4,8 +4,8 @@ CLEAN_SUBDIRS = test
PROGRAM_NAME = $(progname)
PROGRAM_SOURCES = modules.c
-PROGRAM_LDADD = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(PCRE_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
-PROGRAM_PRELINK = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
+PROGRAM_LDADD = buildmark.lo $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(PCRE_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
+PROGRAM_PRELINK = $(LIBTOOL) --mode=compile $(COMPILE) -c $(top_srcdir)/server/buildmark.c
PROGRAM_DEPENDENCIES = \
server/libmain.la \
$(BUILTIN_LIBS) \
@@ -16,7 +16,7 @@ sbin_PROGRAMS = $(PROGRAM_NAME)
TARGETS = $(sbin_PROGRAMS) $(shared_build) $(other_targets)
INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
install-other install-cgi install-include install-suexec install-build \
- install-man
+ install-man install-cygcore
DISTCLEAN_TARGETS = include/ap_config_auto.h include/ap_config_layout.h \
include/apache_probes.h \
@@ -243,6 +243,12 @@ install-suexec:
chmod 4755 $(DESTDIR)$(sbindir)/suexec; \
fi
+install-cygcore:
+ @if test -n '$(sbin_PROGRAMS)'; then \
+ test -d $(DESTDIR)$(libdir) || $(MKINSTALLDIRS) $(DESTDIR)$(libdir); \
+ $(LIBTOOL) --mode=install install $(CORE_IMPLIB) $(DESTDIR)$(libdir); \
+ fi
+
suexec:
cd support && $(MAKE) suexec
diff --git a/build/instdso.sh b/build/instdso.sh
index 3ca5272..8a4f9db 100755
--- a/build/instdso.sh
+++ b/build/instdso.sh
@@ -62,13 +62,20 @@ CMD="$SH_LIBTOOL --mode=install $INSTALL_CMD $DSOARCHIVE $TARGETDIR/"
echo $CMD
$CMD || exit $?
-if test "$SYS" = "OS/2"
-then
+case "$SYS" in
+ OS/2)
# on OS/2, aplibtool --install doesn't copy the .la files & we can't
# rename DLLs to have a .so extension or they won't load so none of the
# steps below make sense.
exit 0
-fi
+ ;;
+ CYGWIN*)
+ # On Cygwin we can't rename DLLs either. Libtool will install .la files,
+ # but we _need_ them to allow DSOs built by other software packages to link
+ # against installed DSOs - e.g. mod_dav_svn -> mod_dav.
+ exit 0
+ ;;
+esac
if test -s "$TARGETDIR/$DSOARCHIVE_BASENAME"
then
diff --git a/build/program.mk b/build/program.mk
index 565b51f..7b8043a 100644
--- a/build/program.mk
+++ b/build/program.mk
@@ -18,6 +18,13 @@
PROGRAM_OBJECTS = $(PROGRAM_SOURCES:.c=.lo)
-$(PROGRAM_NAME): $(PROGRAM_DEPENDENCIES) $(PROGRAM_OBJECTS)
+modules.lo: modules.c
+ $(SH_COMPILE)
+
+$(PROGRAM_NAME): $(CORE_IMPLIB)
+ $(LINK) $(PROGRAM_LDFLAGS) $(HTTPD_LDFLAGS) $(CORE_IMPLIB)
+
+$(CORE_IMPLIB): $(PROGRAM_DEPENDENCIES) $(PROGRAM_OBJECTS)
$(PROGRAM_PRELINK)
- $(LINK) $(PROGRAM_LDFLAGS) $(PROGRAM_OBJECTS) $(PROGRAM_LDADD)
+ $(LINK) -no-undefined -avoid-version -rpath $(exp_libdir) $(PROGRAM_LDFLAGS) $(PROGRAM_OBJECTS) $(PROGRAM_LDADD)
+
diff --git a/configure b/configure
index f80f5ea..1c39999 100755
--- a/configure
+++ b/configure
@@ -4460,7 +4460,7 @@ rm -f confcache
apr_configure_args="--disable-option-checking $apr_configure_args"
- if eval $SHELL $ac_abs_srcdir/configure $apr_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $apache_apr_flags --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir --datadir=$datadir --with-installbuilddir=$installbuilddir
+ if eval $SHELL $ac_abs_srcdir/configure $apr_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $apache_apr_flags --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir --datadir=$datadir --with-installbuilddir=$installbuilddir --enable-threads=pthread ac_cv_header_windows_h=no ac_cv_header_winsock2_h=no ac_cv_define_TCP_NOPUSH=no
then :
echo "srclib/apr configured properly"
else
@@ -6323,6 +6323,13 @@ case $host in
LTCFLAGS=""
;;
esac
+ case $host in
+ *cygwin*)
+ SH_LIBS="\$(AP_LIBS) \$(EXTRA_LIBS)"
+ SH_LDFLAGS="-no-undefined -shrext .so"
+ CORE_IMPLIB="\$(top_builddir)/libhttpd2core.la"
+ ;;
+ esac
;;
esac
@@ -11723,8 +11730,8 @@ cache_objs="mod_cache.lo cache_storage.lo cache_util.lo "
cache_disk_objs="mod_cache_disk.lo"
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time
# and we need some from main cache module
cache_disk_objs="$cache_disk_objs mod_cache.la"
;;
@@ -20924,7 +20931,7 @@ proxy_ajp_objs="mod_proxy_ajp.lo ajp_header.lo ajp_link.lo ajp_msg.lo ajp_utils.
proxy_balancer_objs="mod_proxy_balancer.lo"
case "$host" in
- *os2*)
+ *os2*|*cygwin*)
# OS/2 DLLs must resolve all symbols at build time and
# these sub-modules need some from the main proxy module
proxy_connect_objs="$proxy_connect_objs mod_proxy.la"
@@ -22292,7 +22299,7 @@ $as_echo "$enable_proxy_express$_apmod_extra_msg" >&6; }
if test -z ""; then
- objects="mod_proxy_express.lo"
+ objects="mod_proxy_express.lo mod_proxy.la"
else
objects=""
fi
@@ -22410,8 +22417,8 @@ session_crypto_objects='mod_session_crypto.lo'
session_dbd_objects='mod_session_dbd.lo'
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time
# and we need some from main session module
session_cookie_objects="$session_cookie_objects mod_session.la"
session_crypto_objects="$session_crypto_objects mod_session.la"
@@ -27424,8 +27431,8 @@ EOF
heartbeat_objects='mod_heartbeat.lo'
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time
# and we need some from the watchdog module
heartbeat_objects="$heartbeat_objects ../core/mod_watchdog.la"
;;
@@ -29442,8 +29449,8 @@ else
fi
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time
# and we need some from main DAV module
dav_fs_objects="$dav_fs_objects ../main/mod_dav.la"
;;
@@ -29632,8 +29639,8 @@ EOF
dav_lock_objects="mod_dav_lock.lo locks.lo"
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time
# and we need some from main DAV module
dav_lock_objects="$dav_lock_objects ../main/mod_dav.la"
;;
diff --git a/configure.in b/configure.in
index 1d65bd3..0c4d944 100644
--- a/configure.in
+++ b/configure.in
@@ -111,7 +111,7 @@ fi
if test "$apr_found" = "reconfig"; then
APR_SUBDIR_CONFIG(srclib/apr,
- [$apache_apr_flags --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir --datadir=$datadir --with-installbuilddir=$installbuilddir],
+ [$apache_apr_flags --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir --includedir=$includedir --bindir=$bindir --datadir=$datadir --with-installbuilddir=$installbuilddir --enable-threads=pthread ac_cv_header_windows_h=no ac_cv_header_winsock2_h=no ac_cv_define_TCP_NOPUSH=no],
[--enable-layout=*|\'--enable-layout=*])
dnl We must be the first to build and the last to be cleaned
AP_BUILD_SRCLIB_DIRS="apr $AP_BUILD_SRCLIB_DIRS"
@@ -296,6 +296,13 @@ case $host in
LTCFLAGS=""
;;
esac
+ case $host in
+ *cygwin*)
+ SH_LIBS="\$(AP_LIBS) \$(EXTRA_LIBS)"
+ SH_LDFLAGS="-no-undefined -shrext .so"
+ CORE_IMPLIB="\$(top_builddir)/libhttpd2core.la"
+ ;;
+ esac
;;
esac
APACHE_SUBST(SHLTCFLAGS)
diff --git a/modules/cache/config.m4 b/modules/cache/config.m4
index 2fe41e1..d51384f 100644
--- a/modules/cache/config.m4
+++ b/modules/cache/config.m4
@@ -15,8 +15,8 @@ cache_util.lo dnl
cache_disk_objs="mod_cache_disk.lo"
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time
# and we need some from main cache module
cache_disk_objs="$cache_disk_objs mod_cache.la"
;;
diff --git a/modules/cluster/config5.m4 b/modules/cluster/config5.m4
index 8667316..3b97db2 100644
--- a/modules/cluster/config5.m4
+++ b/modules/cluster/config5.m4
@@ -4,8 +4,8 @@ APACHE_MODPATH_INIT(cluster)
heartbeat_objects='mod_heartbeat.lo'
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time
# and we need some from the watchdog module
heartbeat_objects="$heartbeat_objects ../core/mod_watchdog.la"
;;
diff --git a/modules/dav/fs/config6.m4 b/modules/dav/fs/config6.m4
index dd26ec8..3a5f9b2 100644
--- a/modules/dav/fs/config6.m4
+++ b/modules/dav/fs/config6.m4
@@ -11,8 +11,8 @@ else
fi
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time
# and we need some from main DAV module
dav_fs_objects="$dav_fs_objects ../main/mod_dav.la"
;;
diff --git a/modules/dav/lock/config6.m4 b/modules/dav/lock/config6.m4
index 02a05e5..16d7877 100644
--- a/modules/dav/lock/config6.m4
+++ b/modules/dav/lock/config6.m4
@@ -5,8 +5,8 @@ APACHE_MODPATH_INIT(dav/lock)
dav_lock_objects="mod_dav_lock.lo locks.lo"
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time and
# and we need some from main DAV module
dav_lock_objects="$dav_lock_objects ../main/mod_dav.la"
;;
diff --git a/modules/proxy/config.m4 b/modules/proxy/config.m4
index e91cbf4..f9e93f9 100644
--- a/modules/proxy/config.m4
+++ b/modules/proxy/config.m4
@@ -23,8 +23,8 @@ proxy_ajp_objs="mod_proxy_ajp.lo ajp_header.lo ajp_link.lo ajp_msg.lo ajp_utils.
proxy_balancer_objs="mod_proxy_balancer.lo"
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time and
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time and
# these sub-modules need some from the main proxy module
proxy_connect_objs="$proxy_connect_objs mod_proxy.la"
proxy_ftp_objs="$proxy_ftp_objs mod_proxy.la"
diff --git a/modules/session/config.m4 b/modules/session/config.m4
index 7a38185..83c8d8d 100644
--- a/modules/session/config.m4
+++ b/modules/session/config.m4
@@ -20,8 +20,8 @@ session_crypto_objects='mod_session_crypto.lo'
session_dbd_objects='mod_session_dbd.lo'
case "$host" in
- *os2*)
- # OS/2 DLLs must resolve all symbols at build time
+ *os2*|*cygwin*)
+ # DLLs must resolve all symbols at build time
# and we need some from main session module
session_cookie_objects="$session_cookie_objects mod_session.la"
session_crypto_objects="$session_crypto_objects mod_session.la"
diff --git a/docs/conf/httpd.conf.in b/docs/conf/httpd.conf.in
index a46499d..f40b84f 100644
--- a/docs/conf/httpd.conf.in
+++ b/docs/conf/httpd.conf.in
@@ -74,8 +74,8 @@ Listen @@Port@@
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
-User daemon
-Group daemon
+#User daemon
+#Group daemon
</IfModule>
@@ -397,6 +397,10 @@ Include @rel_sysconfdir@/extra/proxy-html.conf
# Secure (SSL/TLS) connections
#Include @rel_sysconfdir@/extra/httpd-ssl.conf
+
+# Provide a way for additional packages to add configuration fragments
+#Include @rel_sysconfdir@/conf.d/*.conf
+
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
diff --git a/support/apxs.in b/support/apxs.in
index 8bdc2da..ec36d05 100644
--- a/support/apxs.in
+++ b/support/apxs.in
@@ -48,6 +48,9 @@ my $libexecdir = get_vars("libexecdir");
my $CFG_LIBEXECDIR = eval qq("$libexecdir");
my $sbindir = get_vars("sbindir");
my $CFG_SBINDIR = eval qq("$sbindir");
+my $libdir = get_vars("libdir");
+my $CFG_LIBDIR = eval qq("$libdir");
+my $SH_LDFLAGS = get_vars("SH_LDFLAGS");
my $ltflags = $ENV{'LTFLAGS'};
$ltflags or $ltflags = "--silent";
@@ -464,9 +467,14 @@ if ($opt_c) {
$opt .= " ".$apu_libs." ".$apr_libs;
}
else {
- my $apr_ldflags=`$apr_config --ldflags`;
- chomp($apr_ldflags);
- $opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version $apr_ldflags";
+ my $apr_libs = `$apr_config --ldflags --link-libtool --libs`;
+ chomp($apr_libs);
+ my $apu_libs = `$apu_config --ldflags --link-libtool --libs`;
+ chomp($apu_libs);
+
+ $opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version";
+ $opt .= " $SH_LDFLAGS -L$CFG_LIBDIR -lhttpd2core";
+ $opt .= " ".$apu_libs." ".$apr_libs;
}
push(@cmds, "$libtool $ltflags --mode=link $CFG_CC $ldflags -o $dso_file $opt $lo");
diff --git a/build/install.sh b/build/install.sh
index c5d20da..abf4864 100755
--- a/build/install.sh
+++ b/build/install.sh
@@ -102,6 +102,14 @@ fi
src="$src$ext"
dst="$dst$ext"
+# Automagically append .exe - this is needed because libtool will not pass
+# unknown options to an install program, so we are unable to use "-e .exe"
+# in this case.
+if [ -f "$src.exe" ]; then
+ src="$src.exe"
+ dst="$dst.exe"
+fi
+
# Make a temp file name in the proper directory.
dstdir=`dirname $dst`
dsttmp=$dstdir/#inst.$$#
......@@ -4,16 +4,8 @@ extends =
parts =
bison
[bison-drop.gets.patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = ac06cbaa298ac686d0b0c04bc03e6ad8
download-only = true
filename = drop.gets.patch
[bison]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies = m4
url = http://ftp.gnu.org/gnu/bison/bison-2.5.tar.bz2
md5sum = 9dba20116b13fc61a0846b0058fbe004
environment =
M4=${m4:location}/bin/m4
......@@ -2,19 +2,16 @@
parts =
bzip2
[bzip2-hooks-download]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = 066c8355b7d726f30176ea5b6a35e1a2
download-only = true
filename = bzip2-hooks.py
[bzip2]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
md5sum = 00b516f4704d4a7cb50a1d97e6e8e15b
configure-command = true
make-options =
PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
CFLAGS="-fpic -fPIC -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64"
post-make-hook = ${bzip2-hooks-download:location}/${bzip2-hooks-download:filename}:post_make_hook
configure-command = autoconf && ./configure
configure-options = --enable-shared
patch-options = -p1
patches = ${:_profile_base_location_}/bzip2-autotools-buildfiles.patch
[x86-cygwin-bzip2]
patches-cygwin =
${bzip2:patches}
${:_profile_base_location_}/cygwin-bzip2-1.0.6.src.patch
\ No newline at end of file
diff --git bzip2-1.0.6/Makefile.in bzip2-1.0.6/Makefile.in
new file mode 100644
index 0000000..fe3b120
--- /dev/null
+++ bzip2-1.0.6/Makefile.in
@@ -0,0 +1,381 @@
+# @configure_input@
+# ------------------------------------------------------------------
+# This file is part of bzip2/libbzip2, a program and library for
+# lossless, block-sorting data compression.
+#
+# bzip2/libbzip2 version 1.0.6 of 6 September 2010
+# Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
+#
+# File: Makefile.in for autoconf configuration
+# Contributed by Keith Marshall <keithmarshall@users.sourceforge.net>
+#
+# Please read the WARNING, DISCLAIMER and PATENTS sections in the
+# README file.
+#
+# This program is released under the terms of the license contained
+# in the file LICENSE.
+# ------------------------------------------------------------------
+
+PACKAGE = @PACKAGE_TARNAME@
+VERSION = @PACKAGE_VERSION@
+
+# If building libbz2 as a shared library, we use these version tags,
+SO_VER = 1
+SO_AGE = 0
+SO_REV = 6
+#
+# This yields a shared object library name below, following the
+# normal naming rules -- most linux distributions patch Julian's
+# original makefile to do something similar.
+#
+SO_MAJOR := $(shell expr $(SO_VER) - $(SO_AGE))
+SONAME = libbz2.so.$(SO_MAJOR)
+SOFULL = $(SONAME).$(SO_AGE).$(SO_REV)
+
+# For MS-Windows hosts, Julian's original build strategy, (and that
+# still adopted for building with MSVC), creates an unversioned DLL,
+# exporting functions using the __stdcall (WINAPI) calling convention.
+# Conversly, MinGW developers have chosen to sanitise the libbz2 ABI,
+# avoiding the use of the __stdcall calling convention, in favour of
+# the more GNU/Linux-alike __cdecl convention.
+#
+# To permit MinGW builds of libbz2.dll to co-exist, in the developer
+# universe, with MSVC builds, the MinGW Project has specified a scheme
+# for distribution of versioned DLLs, unambiguously named libbz2-N.dll,
+# where N is an ABI version number, nominally computed as:
+#
+# SO_VER - SO_AGE (ignoring SO_REV)
+#
+# Unfortunately, at an early stage in the evolution of the MinGW
+# versioned libbz2-N.dll, at a time when this version paradigm would
+# have yielded N = 1, a libbz2-1.dll was released, which employed the
+# __stdcall calling convention. Thus, to avoid potential confusion
+# with this early release, and specific to the case of libbz2-N.dll,
+# the DLLVER for the __cdecl releases, as computed by the configure
+# script will lead the nominal value by one, becoming effectively:
+#
+# 1 + SO_VER - SO_AGE
+#
+# Note that for cygwin, a similar scheme (SO_VER - SO_AGE) is used,
+# but on that platform the extra +1 is not needed.
+DLLVER = @DLLVER@
+DLLNAME = @DLLNAME@
+LIBNAME = libbz2
+
+
+# Shell used by make...
+#
+SHELL = @SHELL@
+
+# Where to find the sources...
+#
+VPATH = ${srcdir}
+srcdir = @srcdir@
+
+# To assist in cross-compiling...
+#
+CC = @CC@
+AR = @AR@
+RANLIB = @RANLIB@
+LN_S = @LN_S@
+
+OBJEXT = @OBJEXT@
+EXEEXT = @EXEEXT@
+
+BIGFILES = -D_FILE_OFFSET_BITS=64
+CFLAGS = @CFLAGS@ $(BIGFILES)
+LDFLAGS = @LDFLAGS@
+ARFLAGS = @ARFLAGS@
+
+# Where you want it installed when you do 'make install'
+#
+PREFIX = @prefix@
+
+OBJS= blocksort.$(OBJEXT) \
+ huffman.$(OBJEXT) \
+ crctable.$(OBJEXT) \
+ randtable.$(OBJEXT) \
+ compress.$(OBJEXT) \
+ decompress.$(OBJEXT) \
+ bzlib.$(OBJEXT)
+
+# Default build goals...
+#
+all: all-libs bzip2$(EXEEXT) bzip2recover$(EXEEXT)
+all-libs: libbz2.a @enable_shared@
+
+bzip2$(EXEEXT): libbz2.a bzip2.$(OBJEXT)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ bzip2.$(OBJEXT) -L. -lbz2
+
+bzip2recover$(EXEEXT): bzip2recover.$(OBJEXT)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+libbz2.a: $(OBJS)
+ rm -f $@
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+ $(RANLIB) $@
+
+blocksort.$(OBJEXT): blocksort.c
+ @cat ${srcdir}/words0
+ $(CC) $(CFLAGS) -c -o $@ $^
+
+%.$(OBJEXT): %.c
+ $(CC) $(CFLAGS) -c -o$@ $<
+
+# Building using a shared library, for dynamic linking on GNU/Linux...
+# (Invoked when configured with `--enable-shared' for a non-Win32 host).
+#
+# This is incorporated from Julian's original Makefile-libbz2_so.
+# It is reported to work successfully on x86-Linux (Red Hat 7.2), with
+# gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98); YMMV.
+#
+# Please refer to README, for important information regarding building
+# libbz2 as a shared library, in this manner.
+#
+PICFLAGS = -fpic -fPIC -Wall -Winline $(CFLAGS)
+
+all-bzip2-shared: bzip2-shared$(EXEEXT)
+bzip2-shared$(EXEEXT): bzip2.c $(SOFULL)
+ $(CC) $(PICFLAGS) -o $@ $^
+
+$(SOFULL): $(OBJS:.$(OBJEXT)=-pic.$(OBJEXT))
+ $(CC) -shared -Wl,-soname -Wl,$(SONAME) -o $@ $^
+ rm -f $(SONAME); $(LN_S) $@ $(SONAME)
+ rm -f $(SONAME).$(SO_AGE); $(LN_S) $@ $(SONAME).$(SO_AGE)
+
+%-pic.$(OBJEXT): %.c
+ $(CC) $(PICFLAGS) -c -o $@ $<
+
+# Building using a shared library, for dynamic linking on MS-Windows
+# and cygwin...
+# (Invoked when configured with `--enable-shared' for a Win32/cygwin host)
+
+all-dll-shared: $(LIBNAME).dll.a
+
+$(LIBNAME).dll.a: $(DLLNAME)-$(DLLVER).dll
+
+$(DLLNAME)-$(DLLVER).dll: libbz2.def libbz2.a
+ $(CC) -shared -o $@ $(LDFLAGS) -Wl,--out-implib=$(LIBNAME).dll.a $^
+
+libbz2.def: libbz2.def.in
+ sed -e s,%DLLNAME%,$(DLLNAME), -e s,%DLLVER%,$(DLLVER), $^ > $@
+
+# Build validation...
+#
+check: test
+test: bzip2$(EXEEXT)
+ @cat ${srcdir}/words1
+ ./bzip2$(EXEEXT) -1 < ${srcdir}/sample1.ref > sample1.rb2
+ ./bzip2$(EXEEXT) -2 < ${srcdir}/sample2.ref > sample2.rb2
+ ./bzip2$(EXEEXT) -3 < ${srcdir}/sample3.ref > sample3.rb2
+ ./bzip2$(EXEEXT) -d < ${srcdir}/sample1.bz2 > sample1.tst
+ ./bzip2$(EXEEXT) -d < ${srcdir}/sample2.bz2 > sample2.tst
+ ./bzip2$(EXEEXT) -ds < ${srcdir}/sample3.bz2 > sample3.tst
+ cmp ${srcdir}/sample1.bz2 sample1.rb2
+ cmp ${srcdir}/sample2.bz2 sample2.rb2
+ cmp ${srcdir}/sample3.bz2 sample3.rb2
+ cmp sample1.tst ${srcdir}/sample1.ref
+ cmp sample2.tst ${srcdir}/sample2.ref
+ cmp sample3.tst ${srcdir}/sample3.ref
+ @cat ${srcdir}/words3
+
+# GNU Standard Specifications for Installation Directories...
+#
+prefix = $(PREFIX)
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+datarootdir = @datarootdir@
+includedir = @includedir@
+libdir = @libdir@
+
+# `man' Documentation Hierarchy, in Terms of GNU Standards...
+#
+# FIXME: Julian's original distribution wasn't fully compliant
+# with current GNU Standards; to achieve compliance, we must use
+# this autotool standard definition:
+#
+# mandir = @mandir@
+#
+# in place of:
+#
+# mandir = $(PREFIX)/man
+#
+# which preserves Julian's original configuration.
+#
+mandir = $(PREFIX)/man
+man1dir = ${mandir}/man1
+
+# Installation...
+#
+FORCE:
+${bindir} ${includedir} ${libdir} ${man1dir}: FORCE
+ test -d $@ || mkdir -p $@
+
+install: all ${bindir} ${includedir} ${libdir} ${man1dir}
+ cp -f bzip2$(EXEEXT) ${bindir}/bzip2$(EXEEXT)
+ cp -f bzip2$(EXEEXT) ${bindir}/bunzip2$(EXEEXT)
+ cp -f bzip2$(EXEEXT) ${bindir}/bzcat$(EXEEXT)
+ cp -f bzip2recover$(EXEEXT) ${bindir}/bzip2recover$(EXEEXT)
+ if test -f $(DLLNAME)-$(DLLVER).dll; \
+ then \
+ cp -f $(DLLNAME)-$(DLLVER).dll ${bindir}/$(DLLNAME)-$(DLLVER).dll; \
+ chmod a+rx ${bindir}/$(DLLNAME)-$(DLLVER).dll; \
+ fi
+ chmod a+x ${bindir}/bzip2$(EXEEXT)
+ chmod a+x ${bindir}/bunzip2$(EXEEXT)
+ chmod a+x ${bindir}/bzcat$(EXEEXT)
+ chmod a+x ${bindir}/bzip2recover$(EXEEXT)
+ cp -f ${srcdir}/bzlib.h ${includedir}
+ chmod a+r ${includedir}/bzlib.h
+ cp -f libbz2.a ${libdir}
+ if test -f $(LIBNAME).dll.a; \
+ then \
+ cp -f $(LIBNAME).dll.a ${libdir}/$(LIBNAME).dll.a; \
+ chmod a+r ${libdir}/$(LIBNAME).dll.a; \
+ fi
+ chmod a+r ${libdir}/libbz2.a
+ if test -f $(SOFULL); \
+ then \
+ cp -f $(SOFULL) ${libdir}; \
+ cd ${libdir}; rm -f $(SO_NAME).$(SO_AGE) $(SONAME); \
+ $(LN_S) $(SOFULL) $(SONAME).$(SO_AGE); \
+ $(LN_S) $(SOFULL) $(SONAME); \
+ chmod a+r $(SOFULL); \
+ fi
+ cp -f ${srcdir}/bzgrep ${bindir}/bzgrep
+ cd ${bindir}; $(LN_S) -f bzgrep bzegrep
+ cd ${bindir}; $(LN_S) -f bzgrep bzfgrep
+ chmod a+x ${bindir}/bzgrep
+ cp -f ${srcdir}/bzmore ${bindir}/bzmore
+ cd ${bindir}; $(LN_S) -f bzmore bzless
+ chmod a+x ${bindir}/bzmore
+ cp -f ${srcdir}/bzdiff ${bindir}/bzdiff
+ cd ${bindir}; $(LN_S) -f bzdiff bzcmp
+ chmod a+x ${bindir}/bzdiff
+ cd ${srcdir}; cp -f bzip2.1 bzgrep.1 bzmore.1 bzdiff.1 ${man1dir}
+ chmod a+r ${man1dir}/bzip2.1
+ chmod a+r ${man1dir}/bzgrep.1
+ chmod a+r ${man1dir}/bzmore.1
+ chmod a+r ${man1dir}/bzdiff.1
+ echo ".so man1/bzgrep.1" > ${man1dir}/bzegrep.1
+ echo ".so man1/bzgrep.1" > ${man1dir}/bzfgrep.1
+ echo ".so man1/bzmore.1" > ${man1dir}/bzless.1
+ echo ".so man1/bzdiff.1" > ${man1dir}/bzcmp.1
+
+ldconfig:
+ ldconfig -n ${libdir}
+
+# Housekeeping...
+#
+clean:
+ cmp > /dev/null 2>&1 ${srcdir}/libbz2.def libbz2.def \
+ || rm -f libbz2.def
+ rm -f *.$(OBJEXT) libbz2*.a $(DLLNAME)*.dll \
+ bzip2$(EXEEXT) bzip2recover$(EXEEXT) \
+ sample1.rb2 sample2.rb2 sample3.rb2 \
+ sample1.tst sample2.tst sample3.tst
+
+distclean: clean
+ rm -f config.status config.log Makefile
+
+# NOTE: Julian's original Makefile had these in `distclean'.
+# Since they are `distributables', that might have surprised
+# users expecting GNU standard behaviour; they rightfully
+# belong in `maintainer-clean'.
+#
+maintainer-clean: clean
+ rm -f manual.ps manual.html manual.pdf
+
+# Distribution...
+#
+DISTNAME = $(PACKAGE)-$(VERSION)
+#
+# FIXME: this method of creating a source distribution works fine
+# on systems which fully support symbolic links between directories;
+# it cannot be used reliably, on MS-Windows hosts running MSYS.
+#
+dist: manual
+ rm -f $(DISTNAME) $(DISTNAME)$(SNAPSHOT).*
+ $(LN_S) -f ${srcdir} $(DISTNAME)
+ tar cvf $(DISTNAME)$(SNAPSHOT).tar \
+ $(DISTNAME)/aclocal.m4 \
+ $(DISTNAME)/configure \
+ $(DISTNAME)/configure.ac \
+ $(DISTNAME)/Makefile.in \
+ $(DISTNAME)/blocksort.c \
+ $(DISTNAME)/huffman.c \
+ $(DISTNAME)/crctable.c \
+ $(DISTNAME)/randtable.c \
+ $(DISTNAME)/compress.c \
+ $(DISTNAME)/decompress.c \
+ $(DISTNAME)/bzlib.c \
+ $(DISTNAME)/bzip2.c \
+ $(DISTNAME)/bzip2recover.c \
+ $(DISTNAME)/bzlib.h \
+ $(DISTNAME)/bzlib_private.h \
+ $(DISTNAME)/LICENSE \
+ $(DISTNAME)/bzip2.1 \
+ $(DISTNAME)/bzip2.1.preformatted \
+ $(DISTNAME)/bzip2.txt \
+ $(DISTNAME)/words0 \
+ $(DISTNAME)/words1 \
+ $(DISTNAME)/words2 \
+ $(DISTNAME)/words3 \
+ $(DISTNAME)/sample1.ref \
+ $(DISTNAME)/sample2.ref \
+ $(DISTNAME)/sample3.ref \
+ $(DISTNAME)/sample1.bz2 \
+ $(DISTNAME)/sample2.bz2 \
+ $(DISTNAME)/sample3.bz2 \
+ $(DISTNAME)/dlltest.c \
+ $(DISTNAME)/manual.html \
+ $(DISTNAME)/manual.pdf \
+ $(DISTNAME)/manual.ps \
+ $(DISTNAME)/README \
+ $(DISTNAME)/README.COMPILATION.PROBLEMS \
+ $(DISTNAME)/README.XML.STUFF \
+ $(DISTNAME)/CHANGES \
+ $(DISTNAME)/libbz2.def \
+ $(DISTNAME)/libbz2.def.in \
+ $(DISTNAME)/libbz2.dsp \
+ $(DISTNAME)/dlltest.dsp \
+ $(DISTNAME)/makefile.msc \
+ $(DISTNAME)/unzcrash.c \
+ $(DISTNAME)/spewG.c \
+ $(DISTNAME)/mk251.c \
+ $(DISTNAME)/bzdiff \
+ $(DISTNAME)/bzdiff.1 \
+ $(DISTNAME)/bzmore \
+ $(DISTNAME)/bzmore.1 \
+ $(DISTNAME)/bzgrep \
+ $(DISTNAME)/bzgrep.1 \
+ $(DISTNAME)/Makefile-libbz2_so \
+ $(DISTNAME)/bz-common.xsl \
+ $(DISTNAME)/bz-fo.xsl \
+ $(DISTNAME)/bz-html.xsl \
+ $(DISTNAME)/bzip.css \
+ $(DISTNAME)/entities.xml \
+ $(DISTNAME)/manual.xml \
+ $(DISTNAME)/format.pl \
+ $(DISTNAME)/xmlproc.sh
+ gzip -v $(DISTNAME)$(SNAPSHOT).tar
+ rm -f $(DISTNAME)
+
+# For rebuilding the manual from sources on Julian's SuSE 9.1 box
+#
+MANUAL_SRCS = bz-common.xsl bz-fo.xsl bz-html.xsl bzip.css \
+ entities.xml manual.xml
+
+manual: manual.html manual.ps manual.pdf
+
+manual.ps: $(MANUAL_SRCS)
+ ${srcdir}/xmlproc.sh -ps manual.xml
+
+manual.pdf: $(MANUAL_SRCS)
+ ${srcdir}/xmlproc.sh -pdf manual.xml
+
+manual.html: $(MANUAL_SRCS)
+ ${srcdir}/xmlproc.sh -html manual.xml
+
+# Makefile: end of file
diff --git bzip2-1.0.6/README.CYGMING bzip2-1.0.6/README.CYGMING
new file mode 100644
index 0000000..70f08d2
--- /dev/null
+++ bzip2-1.0.6/README.CYGMING
@@ -0,0 +1,52 @@
+This distribution was built using an alternate build system.
+The original distribution used a simple Makefile, which had to
+be heavily customized to meet the needs of modern cygwin and
+MinGW systems. Furthermore, it was wholly unsuited for building
+the distribution in a cross-hosted environment.
+
+Keith Marshall <keithmarshall@users.sf.net> implemented an
+autoconf-based build system, to facilitate cross-hosted building
+for use with MinGW. This build system consists of the following
+original files:
+ configure.ac
+ Makefile.in
+ aclocal.m4
+ libbz2.def.in
+found in the 'cygming-autotools-buildfiles.tar.gz' tarball included
+within the bzip2-$VER-$REL-mingw-src tarball.
+
+The source preparation phase of the build runs autoconf, which creates
+the following file(s):
+ configure
+In addition, the source preparation phase explicitly removes the
+original Makefile from the $srcdir, as a new Makefile will be generated
+in the $builddir by the configure phase of the build.
+
+This configure script is NOT distributed in this package; it is assumed
+that the 'autoconf' tool is available. The proper (non-automated)
+procedure is:
+
+ unpack bzip2-$VER-$REL-mingw-src.tar.gz
+
+This will create a number of new files, included several additional
+tarballs and patches.
+
+ unpack the upstream source tarbal bzip2-$VER.tar.gz
+ unpack the extra 'cygming-autotools-buildfiles.tar.gz' tarball
+ cd bzip2-$VER
+ autoconf
+ mkdir ../build
+ cd ../build
+ ../bzip2-$VER/configure [various options]
+ make
+
+However, the automated procedure, which can be used to exactly reproduce
+the official mingw package, is:
+
+ ./pkgbuild
+
+which performs all of the above steps, as well as applying the various
+patches, installing into a local staging area, and generating the mingw-get
+compatible installation packages. See mingw-bzip2.RELEASE_NOTES.txt for
+more information.
+
diff --git bzip2-1.0.6/aclocal.m4 bzip2-1.0.6/aclocal.m4
new file mode 100644
index 0000000..eeda952
--- /dev/null
+++ bzip2-1.0.6/aclocal.m4
@@ -0,0 +1,115 @@
+# aclocal.m4 -*- Autoconf -*- vim: filetype=config
+# ------------------------------------------------------------------
+# This file is part of bzip2/libbzip2, a program and library for
+# lossless, block-sorting data compression.
+#
+# bzip2/libbzip2 version 1.0.5 of 10 December 2007
+# Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
+#
+# File: aclocal.m4 for autoconf configuration
+# Contributed by Keith Marshall <keithmarshall@users.sourceforge.net>
+#
+# Please read the WARNING, DISCLAIMER and PATENTS sections in the
+# README file.
+#
+# This program is released under the terms of the license contained
+# in the file LICENSE.
+# ------------------------------------------------------------------
+
+# BZIP2_AC_WINDOWS_HOST
+# ---------------------
+# Check if the runtime platform is a native MS-Windows host.
+# FIXME: is checking _WIN64 an appropriate choice, for 64-bit Windows?
+# Because we only need to know whether the host is (native) win32
+# or not, we can avoid the expensive AC_CANONICAL_HOST checks.
+#
+AC_DEFUN([BZIP2_AC_WINDOWS_HOST],
+[AC_CACHE_CHECK([whether we are building for an MS-Windows host],
+ [bzip2_cv_windows_host],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+@%:@if defined _WIN32 || defined _WIN64
+ choke me
+@%:@endif]])],
+[bzip2_cv_windows_host=no], [bzip2_cv_windows_host=yes]))dnl
+])# BZIP2_AC_WINDOWS_HOST
+
+# BZIP2_AC_CYGWIN_HOST
+# ---------------------
+# Check if the runtime platform is a cygwin host.
+# Because we only need to know whether the host is cygwin
+# or not, we can avoid the expensive AC_CANONICAL_HOST checks.
+#
+AC_DEFUN([BZIP2_AC_CYGWIN_HOST],
+[AC_CACHE_CHECK([whether we are building for a cygwin host],
+ [bzip2_cv_cygwin_host],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+@%:@if defined __CYGWIN__
+ choke me
+@%:@endif]])],
+[bzip2_cv_cygwin_host=no], [bzip2_cv_cygwin_host=yes]))dnl
+])# BZIP2_AC_CYGWIN_HOST
+
+# BZIP2_AC_ENABLE_SHARED
+# ----------------------
+# Check if the user is configuring with `--enable-shared';
+# if yes, activate shared library build support as appropriate,
+# for the host on which this build is to be deployed.
+#
+AC_DEFUN([BZIP2_AC_ENABLE_SHARED],
+[AC_REQUIRE([BZIP2_AC_WINDOWS_HOST])dnl
+ AC_REQUIRE([BZIP2_AC_CYGWIN_HOST])dnl
+ AC_MSG_CHECKING([for make goal to build shared libraries])
+ AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared],
+ [enable building as a shared library @<:@default=no@:>@])],
+ [if test "x$enable_shared" = xyes
+ then
+ if test "x${bzip2_cv_windows_host}" = xyes ||
+ test "x${bzip2_cv_cygwin_host}" = xyes
+ then
+ enable_shared="all-dll-shared"
+ else
+ enable_shared="all-bzip2-shared"
+ fi
+ else
+ enable_shared="none"
+ fi
+ ], [enable_shared="none"])dnl
+ AC_MSG_RESULT([${enable_shared}])
+ [test "x$enable_shared" = xnone && enable_shared=""]
+ AC_SUBST([enable_shared])dnl
+])# BZIP2_AC_ENABLE_SHARED
+
+# BZIP2_AC_SUBST_DLLVER
+# ---------------------
+# Establish the ABI version number for MS-Windows shared libraries;
+# this is derived from the universal SO_VER and SO_AGE properties, as
+# specified in `Makefile.in'; (nominally, it is SO_VER - SO_AGE, but
+# see the note in `Makefile.in', explaining why, in this instance,
+# we use one more than that nominal value for $host = mingw32)
+#
+AC_DEFUN([BZIP2_AC_SUBST_DLLVER],
+[AC_REQUIRE([BZIP2_AC_WINDOWS_HOST])dnl
+ AC_MSG_CHECKING([for API version of DLL shared libraries])
+ [SO_VER=`FS=' ';sed -n "/^[$FS]*SO_VER[$FS]*=[$FS]*/s///p" ${srcdir}/Makefile.in`]
+ [SO_AGE=`FS=' ';sed -n "/^[$FS]*SO_AGE[$FS]*=[$FS]*/s///p" ${srcdir}/Makefile.in`]
+ [dllver=`expr ${SO_VER} - ${SO_AGE}`
+ test "x$bzip2_cv_windows_host" = xyes && dllver=`expr 1 + ${SO_VER} - ${SO_AGE}`]
+ AC_SUBST([DLLVER], [${dllver}])
+ AC_MSG_RESULT([${dllver}])dnl
+])# BZIP2_AC_SUBST_DLLVER
+
+# BZIP2_AC_SUBST_DLLNAME
+# ----------------------
+# Establish the base name MS-Windows or cygwin shared libraries;
+#
+AC_DEFUN([BZIP2_AC_SUBST_DLLNAME],
+[AC_REQUIRE([BZIP2_AC_WINDOWS_HOST])dnl
+ AC_MSG_CHECKING([for base name of DLL shared libraries])
+ [dllname=cygbz2
+ test "x$bzip2_cv_windows_host" = xyes && dllname=libbz2]
+ AC_SUBST([DLLNAME], [${dllname}])
+ AC_MSG_RESULT([${dllname}])dnl
+])# BZIP2_AC_SUBST_DLLNAME
+
+# aclocal.m4: end of file
diff --git bzip2-1.0.6/bzip2.c.orig bzip2-1.0.6/bzip2.c.orig
new file mode 100644
index 0000000..d55177b
--- /dev/null
+++ bzip2-1.0.6/bzip2.c.orig
@@ -0,0 +1,2034 @@
+
+/*-----------------------------------------------------------*/
+/*--- A block-sorting, lossless compressor bzip2.c ---*/
+/*-----------------------------------------------------------*/
+
+/* ------------------------------------------------------------------
+ This file is part of bzip2/libbzip2, a program and library for
+ lossless, block-sorting data compression.
+
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
+
+ Please read the WARNING, DISCLAIMER and PATENTS sections in the
+ README file.
+
+ This program is released under the terms of the license contained
+ in the file LICENSE.
+ ------------------------------------------------------------------ */
+
+
+/* Place a 1 beside your platform, and 0 elsewhere.
+ Generic 32-bit Unix.
+ Also works on 64-bit Unix boxes.
+ This is the default.
+*/
+#define BZ_UNIX 1
+
+/*--
+ Win32, as seen by Jacob Navia's excellent
+ port of (Chris Fraser & David Hanson)'s excellent
+ lcc compiler. Or with MS Visual C.
+ This is selected automatically if compiled by a compiler which
+ defines _WIN32, not including the Cygwin GCC.
+--*/
+#define BZ_LCCWIN32 0
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#undef BZ_LCCWIN32
+#define BZ_LCCWIN32 1
+#undef BZ_UNIX
+#define BZ_UNIX 0
+#endif
+
+
+/*---------------------------------------------*/
+/*--
+ Some stuff for all platforms.
+--*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <math.h>
+#include <errno.h>
+#include <ctype.h>
+#include "bzlib.h"
+
+#define ERROR_IF_EOF(i) { if ((i) == EOF) ioError(); }
+#define ERROR_IF_NOT_ZERO(i) { if ((i) != 0) ioError(); }
+#define ERROR_IF_MINUS_ONE(i) { if ((i) == (-1)) ioError(); }
+
+
+/*---------------------------------------------*/
+/*--
+ Platform-specific stuff.
+--*/
+
+#if BZ_UNIX
+# include <fcntl.h>
+# include <sys/types.h>
+# include <utime.h>
+# include <unistd.h>
+# include <sys/stat.h>
+# include <sys/times.h>
+
+# define PATH_SEP '/'
+# define MY_LSTAT lstat
+# define MY_STAT stat
+# define MY_S_ISREG S_ISREG
+# define MY_S_ISDIR S_ISDIR
+
+# define APPEND_FILESPEC(root, name) \
+ root=snocString((root), (name))
+
+# define APPEND_FLAG(root, name) \
+ root=snocString((root), (name))
+
+# define SET_BINARY_MODE(fd) /**/
+
+# ifdef __GNUC__
+# define NORETURN __attribute__ ((noreturn))
+# else
+# define NORETURN /**/
+# endif
+
+# ifdef __DJGPP__
+# include <io.h>
+# include <fcntl.h>
+# undef MY_LSTAT
+# undef MY_STAT
+# define MY_LSTAT stat
+# define MY_STAT stat
+# undef SET_BINARY_MODE
+# define SET_BINARY_MODE(fd) \
+ do { \
+ int retVal = setmode ( fileno ( fd ), \
+ O_BINARY ); \
+ ERROR_IF_MINUS_ONE ( retVal ); \
+ } while ( 0 )
+# endif
+
+# ifdef __CYGWIN__
+# include <io.h>
+# include <fcntl.h>
+# undef SET_BINARY_MODE
+# define SET_BINARY_MODE(fd) \
+ do { \
+ int retVal = setmode ( fileno ( fd ), \
+ O_BINARY ); \
+ ERROR_IF_MINUS_ONE ( retVal ); \
+ } while ( 0 )
+# endif
+#endif /* BZ_UNIX */
+
+
+
+#if BZ_LCCWIN32
+# include <io.h>
+# include <fcntl.h>
+# include <sys/stat.h>
+
+# define NORETURN /**/
+# define PATH_SEP '\\'
+# define MY_LSTAT _stat
+# define MY_STAT _stat
+# define MY_S_ISREG(x) ((x) & _S_IFREG)
+# define MY_S_ISDIR(x) ((x) & _S_IFDIR)
+
+# define APPEND_FLAG(root, name) \
+ root=snocString((root), (name))
+
+# define APPEND_FILESPEC(root, name) \
+ root = snocString ((root), (name))
+
+# define SET_BINARY_MODE(fd) \
+ do { \
+ int retVal = setmode ( fileno ( fd ), \
+ O_BINARY ); \
+ ERROR_IF_MINUS_ONE ( retVal ); \
+ } while ( 0 )
+
+#endif /* BZ_LCCWIN32 */
+
+
+/*---------------------------------------------*/
+/*--
+ Some more stuff for all platforms :-)
+--*/
+
+typedef char Char;
+typedef unsigned char Bool;
+typedef unsigned char UChar;
+typedef int Int32;
+typedef unsigned int UInt32;
+typedef short Int16;
+typedef unsigned short UInt16;
+
+#define True ((Bool)1)
+#define False ((Bool)0)
+
+/*--
+ IntNative is your platform's `native' int size.
+ Only here to avoid probs with 64-bit platforms.
+--*/
+typedef int IntNative;
+
+
+/*---------------------------------------------------*/
+/*--- Misc (file handling) data decls ---*/
+/*---------------------------------------------------*/
+
+Int32 verbosity;
+Bool keepInputFiles, smallMode, deleteOutputOnInterrupt;
+Bool forceOverwrite, testFailsExist, unzFailsExist, noisy;
+Int32 numFileNames, numFilesProcessed, blockSize100k;
+Int32 exitValue;
+
+/*-- source modes; F==file, I==stdin, O==stdout --*/
+#define SM_I2O 1
+#define SM_F2O 2
+#define SM_F2F 3
+
+/*-- operation modes --*/
+#define OM_Z 1
+#define OM_UNZ 2
+#define OM_TEST 3
+
+Int32 opMode;
+Int32 srcMode;
+
+#define FILE_NAME_LEN 1034
+
+Int32 longestFileName;
+Char inName [FILE_NAME_LEN];
+Char outName[FILE_NAME_LEN];
+Char tmpName[FILE_NAME_LEN];
+Char *progName;
+Char progNameReally[FILE_NAME_LEN];
+FILE *outputHandleJustInCase;
+Int32 workFactor;
+
+static void panic ( const Char* ) NORETURN;
+static void ioError ( void ) NORETURN;
+static void outOfMemory ( void ) NORETURN;
+static void configError ( void ) NORETURN;
+static void crcError ( void ) NORETURN;
+static void cleanUpAndFail ( Int32 ) NORETURN;
+static void compressedStreamEOF ( void ) NORETURN;
+
+static void copyFileName ( Char*, Char* );
+static void* myMalloc ( Int32 );
+static void applySavedFileAttrToOutputFile ( IntNative fd );
+
+
+
+/*---------------------------------------------------*/
+/*--- An implementation of 64-bit ints. Sigh. ---*/
+/*--- Roll on widespread deployment of ANSI C9X ! ---*/
+/*---------------------------------------------------*/
+
+typedef
+ struct { UChar b[8]; }
+ UInt64;
+
+
+static
+void uInt64_from_UInt32s ( UInt64* n, UInt32 lo32, UInt32 hi32 )
+{
+ n->b[7] = (UChar)((hi32 >> 24) & 0xFF);
+ n->b[6] = (UChar)((hi32 >> 16) & 0xFF);
+ n->b[5] = (UChar)((hi32 >> 8) & 0xFF);
+ n->b[4] = (UChar) (hi32 & 0xFF);
+ n->b[3] = (UChar)((lo32 >> 24) & 0xFF);
+ n->b[2] = (UChar)((lo32 >> 16) & 0xFF);
+ n->b[1] = (UChar)((lo32 >> 8) & 0xFF);
+ n->b[0] = (UChar) (lo32 & 0xFF);
+}
+
+
+static
+double uInt64_to_double ( UInt64* n )
+{
+ Int32 i;
+ double base = 1.0;
+ double sum = 0.0;
+ for (i = 0; i < 8; i++) {
+ sum += base * (double)(n->b[i]);
+ base *= 256.0;
+ }
+ return sum;
+}
+
+
+static
+Bool uInt64_isZero ( UInt64* n )
+{
+ Int32 i;
+ for (i = 0; i < 8; i++)
+ if (n->b[i] != 0) return 0;
+ return 1;
+}
+
+
+/* Divide *n by 10, and return the remainder. */
+static
+Int32 uInt64_qrm10 ( UInt64* n )
+{
+ UInt32 rem, tmp;
+ Int32 i;
+ rem = 0;
+ for (i = 7; i >= 0; i--) {
+ tmp = rem * 256 + n->b[i];
+ n->b[i] = tmp / 10;
+ rem = tmp % 10;
+ }
+ return rem;
+}
+
+
+/* ... and the Whole Entire Point of all this UInt64 stuff is
+ so that we can supply the following function.
+*/
+static
+void uInt64_toAscii ( char* outbuf, UInt64* n )
+{
+ Int32 i, q;
+ UChar buf[32];
+ Int32 nBuf = 0;
+ UInt64 n_copy = *n;
+ do {
+ q = uInt64_qrm10 ( &n_copy );
+ buf[nBuf] = q + '0';
+ nBuf++;
+ } while (!uInt64_isZero(&n_copy));
+ outbuf[nBuf] = 0;
+ for (i = 0; i < nBuf; i++)
+ outbuf[i] = buf[nBuf-i-1];
+}
+
+
+/*---------------------------------------------------*/
+/*--- Processing of complete files and streams ---*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------*/
+static
+Bool myfeof ( FILE* f )
+{
+ Int32 c = fgetc ( f );
+ if (c == EOF) return True;
+ ungetc ( c, f );
+ return False;
+}
+
+
+/*---------------------------------------------*/
+static
+void compressStream ( FILE *stream, FILE *zStream )
+{
+ BZFILE* bzf = NULL;
+ UChar ibuf[5000];
+ Int32 nIbuf;
+ UInt32 nbytes_in_lo32, nbytes_in_hi32;
+ UInt32 nbytes_out_lo32, nbytes_out_hi32;
+ Int32 bzerr, bzerr_dummy, ret;
+
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
+ bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
+ blockSize100k, verbosity, workFactor );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ if (verbosity >= 2) fprintf ( stderr, "\n" );
+
+ while (True) {
+
+ if (myfeof(stream)) break;
+ nIbuf = fread ( ibuf, sizeof(UChar), 5000, stream );
+ if (ferror(stream)) goto errhandler_io;
+ if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ }
+
+ BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
+ &nbytes_in_lo32, &nbytes_in_hi32,
+ &nbytes_out_lo32, &nbytes_out_hi32 );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ if (ferror(zStream)) goto errhandler_io;
+ ret = fflush ( zStream );
+ if (ret == EOF) goto errhandler_io;
+ if (zStream != stdout) {
+ Int32 fd = fileno ( zStream );
+ if (fd < 0) goto errhandler_io;
+ applySavedFileAttrToOutputFile ( fd );
+ ret = fclose ( zStream );
+ outputHandleJustInCase = NULL;
+ if (ret == EOF) goto errhandler_io;
+ }
+ outputHandleJustInCase = NULL;
+ if (ferror(stream)) goto errhandler_io;
+ ret = fclose ( stream );
+ if (ret == EOF) goto errhandler_io;
+
+ if (verbosity >= 1) {
+ if (nbytes_in_lo32 == 0 && nbytes_in_hi32 == 0) {
+ fprintf ( stderr, " no data compressed.\n");
+ } else {
+ Char buf_nin[32], buf_nout[32];
+ UInt64 nbytes_in, nbytes_out;
+ double nbytes_in_d, nbytes_out_d;
+ uInt64_from_UInt32s ( &nbytes_in,
+ nbytes_in_lo32, nbytes_in_hi32 );
+ uInt64_from_UInt32s ( &nbytes_out,
+ nbytes_out_lo32, nbytes_out_hi32 );
+ nbytes_in_d = uInt64_to_double ( &nbytes_in );
+ nbytes_out_d = uInt64_to_double ( &nbytes_out );
+ uInt64_toAscii ( buf_nin, &nbytes_in );
+ uInt64_toAscii ( buf_nout, &nbytes_out );
+ fprintf ( stderr, "%6.3f:1, %6.3f bits/byte, "
+ "%5.2f%% saved, %s in, %s out.\n",
+ nbytes_in_d / nbytes_out_d,
+ (8.0 * nbytes_out_d) / nbytes_in_d,
+ 100.0 * (1.0 - nbytes_out_d / nbytes_in_d),
+ buf_nin,
+ buf_nout
+ );
+ }
+ }
+
+ return;
+
+ errhandler:
+ BZ2_bzWriteClose64 ( &bzerr_dummy, bzf, 1,
+ &nbytes_in_lo32, &nbytes_in_hi32,
+ &nbytes_out_lo32, &nbytes_out_hi32 );
+ switch (bzerr) {
+ case BZ_CONFIG_ERROR:
+ configError(); break;
+ case BZ_MEM_ERROR:
+ outOfMemory (); break;
+ case BZ_IO_ERROR:
+ errhandler_io:
+ ioError(); break;
+ default:
+ panic ( "compress:unexpected error" );
+ }
+
+ panic ( "compress:end" );
+ /*notreached*/
+}
+
+
+
+/*---------------------------------------------*/
+static
+Bool uncompressStream ( FILE *zStream, FILE *stream )
+{
+ BZFILE* bzf = NULL;
+ Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i;
+ UChar obuf[5000];
+ UChar unused[BZ_MAX_UNUSED];
+ Int32 nUnused;
+ void* unusedTmpV;
+ UChar* unusedTmp;
+
+ nUnused = 0;
+ streamNo = 0;
+
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
+ while (True) {
+
+ bzf = BZ2_bzReadOpen (
+ &bzerr, zStream, verbosity,
+ (int)smallMode, unused, nUnused
+ );
+ if (bzf == NULL || bzerr != BZ_OK) goto errhandler;
+ streamNo++;
+
+ while (bzerr == BZ_OK) {
+ nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
+ if (bzerr == BZ_DATA_ERROR_MAGIC) goto trycat;
+ if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
+ fwrite ( obuf, sizeof(UChar), nread, stream );
+ if (ferror(stream)) goto errhandler_io;
+ }
+ if (bzerr != BZ_STREAM_END) goto errhandler;
+
+ BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused );
+ if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" );
+
+ unusedTmp = (UChar*)unusedTmpV;
+ for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i];
+
+ BZ2_bzReadClose ( &bzerr, bzf );
+ if (bzerr != BZ_OK) panic ( "decompress:bzReadGetUnused" );
+
+ if (nUnused == 0 && myfeof(zStream)) break;
+ }
+
+ closeok:
+ if (ferror(zStream)) goto errhandler_io;
+ if (stream != stdout) {
+ Int32 fd = fileno ( stream );
+ if (fd < 0) goto errhandler_io;
+ applySavedFileAttrToOutputFile ( fd );
+ }
+ ret = fclose ( zStream );
+ if (ret == EOF) goto errhandler_io;
+
+ if (ferror(stream)) goto errhandler_io;
+ ret = fflush ( stream );
+ if (ret != 0) goto errhandler_io;
+ if (stream != stdout) {
+ ret = fclose ( stream );
+ outputHandleJustInCase = NULL;
+ if (ret == EOF) goto errhandler_io;
+ }
+ outputHandleJustInCase = NULL;
+ if (verbosity >= 2) fprintf ( stderr, "\n " );
+ return True;
+
+ trycat:
+ if (forceOverwrite) {
+ rewind(zStream);
+ while (True) {
+ if (myfeof(zStream)) break;
+ nread = fread ( obuf, sizeof(UChar), 5000, zStream );
+ if (ferror(zStream)) goto errhandler_io;
+ if (nread > 0) fwrite ( obuf, sizeof(UChar), nread, stream );
+ if (ferror(stream)) goto errhandler_io;
+ }
+ goto closeok;
+ }
+
+ errhandler:
+ BZ2_bzReadClose ( &bzerr_dummy, bzf );
+ switch (bzerr) {
+ case BZ_CONFIG_ERROR:
+ configError(); break;
+ case BZ_IO_ERROR:
+ errhandler_io:
+ ioError(); break;
+ case BZ_DATA_ERROR:
+ crcError();
+ case BZ_MEM_ERROR:
+ outOfMemory();
+ case BZ_UNEXPECTED_EOF:
+ compressedStreamEOF();
+ case BZ_DATA_ERROR_MAGIC:
+ if (zStream != stdin) fclose(zStream);
+ if (stream != stdout) fclose(stream);
+ if (streamNo == 1) {
+ return False;
+ } else {
+ if (noisy)
+ fprintf ( stderr,
+ "\n%s: %s: trailing garbage after EOF ignored\n",
+ progName, inName );
+ return True;
+ }
+ default:
+ panic ( "decompress:unexpected error" );
+ }
+
+ panic ( "decompress:end" );
+ return True; /*notreached*/
+}
+
+
+/*---------------------------------------------*/
+static
+Bool testStream ( FILE *zStream )
+{
+ BZFILE* bzf = NULL;
+ Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i;
+ UChar obuf[5000];
+ UChar unused[BZ_MAX_UNUSED];
+ Int32 nUnused;
+ void* unusedTmpV;
+ UChar* unusedTmp;
+
+ nUnused = 0;
+ streamNo = 0;
+
+ SET_BINARY_MODE(zStream);
+ if (ferror(zStream)) goto errhandler_io;
+
+ while (True) {
+
+ bzf = BZ2_bzReadOpen (
+ &bzerr, zStream, verbosity,
+ (int)smallMode, unused, nUnused
+ );
+ if (bzf == NULL || bzerr != BZ_OK) goto errhandler;
+ streamNo++;
+
+ while (bzerr == BZ_OK) {
+ nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
+ if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler;
+ }
+ if (bzerr != BZ_STREAM_END) goto errhandler;
+
+ BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused );
+ if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" );
+
+ unusedTmp = (UChar*)unusedTmpV;
+ for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i];
+
+ BZ2_bzReadClose ( &bzerr, bzf );
+ if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" );
+ if (nUnused == 0 && myfeof(zStream)) break;
+
+ }
+
+ if (ferror(zStream)) goto errhandler_io;
+ ret = fclose ( zStream );
+ if (ret == EOF) goto errhandler_io;
+
+ if (verbosity >= 2) fprintf ( stderr, "\n " );
+ return True;
+
+ errhandler:
+ BZ2_bzReadClose ( &bzerr_dummy, bzf );
+ if (verbosity == 0)
+ fprintf ( stderr, "%s: %s: ", progName, inName );
+ switch (bzerr) {
+ case BZ_CONFIG_ERROR:
+ configError(); break;
+ case BZ_IO_ERROR:
+ errhandler_io:
+ ioError(); break;
+ case BZ_DATA_ERROR:
+ fprintf ( stderr,
+ "data integrity (CRC) error in data\n" );
+ return False;
+ case BZ_MEM_ERROR:
+ outOfMemory();
+ case BZ_UNEXPECTED_EOF:
+ fprintf ( stderr,
+ "file ends unexpectedly\n" );
+ return False;
+ case BZ_DATA_ERROR_MAGIC:
+ if (zStream != stdin) fclose(zStream);
+ if (streamNo == 1) {
+ fprintf ( stderr,
+ "bad magic number (file not created by bzip2)\n" );
+ return False;
+ } else {
+ if (noisy)
+ fprintf ( stderr,
+ "trailing garbage after EOF ignored\n" );
+ return True;
+ }
+ default:
+ panic ( "test:unexpected error" );
+ }
+
+ panic ( "test:end" );
+ return True; /*notreached*/
+}
+
+
+/*---------------------------------------------------*/
+/*--- Error [non-] handling grunge ---*/
+/*---------------------------------------------------*/
+
+/*---------------------------------------------*/
+static
+void setExit ( Int32 v )
+{
+ if (v > exitValue) exitValue = v;
+}
+
+
+/*---------------------------------------------*/
+static
+void cadvise ( void )
+{
+ if (noisy)
+ fprintf (
+ stderr,
+ "\nIt is possible that the compressed file(s) have become corrupted.\n"
+ "You can use the -tvv option to test integrity of such files.\n\n"
+ "You can use the `bzip2recover' program to attempt to recover\n"
+ "data from undamaged sections of corrupted files.\n\n"
+ );
+}
+
+
+/*---------------------------------------------*/
+static
+void showFileNames ( void )
+{
+ if (noisy)
+ fprintf (
+ stderr,
+ "\tInput file = %s, output file = %s\n",
+ inName, outName
+ );
+}
+
+
+/*---------------------------------------------*/
+static
+void cleanUpAndFail ( Int32 ec )
+{
+ IntNative retVal;
+ struct MY_STAT statBuf;
+
+ if ( srcMode == SM_F2F
+ && opMode != OM_TEST
+ && deleteOutputOnInterrupt ) {
+
+ /* Check whether input file still exists. Delete output file
+ only if input exists to avoid loss of data. Joerg Prante, 5
+ January 2002. (JRS 06-Jan-2002: other changes in 1.0.2 mean
+ this is less likely to happen. But to be ultra-paranoid, we
+ do the check anyway.) */
+ retVal = MY_STAT ( inName, &statBuf );
+ if (retVal == 0) {
+ if (noisy)
+ fprintf ( stderr,
+ "%s: Deleting output file %s, if it exists.\n",
+ progName, outName );
+ if (outputHandleJustInCase != NULL)
+ fclose ( outputHandleJustInCase );
+ retVal = remove ( outName );
+ if (retVal != 0)
+ fprintf ( stderr,
+ "%s: WARNING: deletion of output file "
+ "(apparently) failed.\n",
+ progName );
+ } else {
+ fprintf ( stderr,
+ "%s: WARNING: deletion of output file suppressed\n",
+ progName );
+ fprintf ( stderr,
+ "%s: since input file no longer exists. Output file\n",
+ progName );
+ fprintf ( stderr,
+ "%s: `%s' may be incomplete.\n",
+ progName, outName );
+ fprintf ( stderr,
+ "%s: I suggest doing an integrity test (bzip2 -tv)"
+ " of it.\n",
+ progName );
+ }
+ }
+
+ if (noisy && numFileNames > 0 && numFilesProcessed < numFileNames) {
+ fprintf ( stderr,
+ "%s: WARNING: some files have not been processed:\n"
+ "%s: %d specified on command line, %d not processed yet.\n\n",
+ progName, progName,
+ numFileNames, numFileNames - numFilesProcessed );
+ }
+ setExit(ec);
+ exit(exitValue);
+}
+
+
+/*---------------------------------------------*/
+static
+void panic ( const Char* s )
+{
+ fprintf ( stderr,
+ "\n%s: PANIC -- internal consistency error:\n"
+ "\t%s\n"
+ "\tThis is a BUG. Please report it to me at:\n"
+ "\tjseward@bzip.org\n",
+ progName, s );
+ showFileNames();
+ cleanUpAndFail( 3 );
+}
+
+
+/*---------------------------------------------*/
+static
+void crcError ( void )
+{
+ fprintf ( stderr,
+ "\n%s: Data integrity error when decompressing.\n",
+ progName );
+ showFileNames();
+ cadvise();
+ cleanUpAndFail( 2 );
+}
+
+
+/*---------------------------------------------*/
+static
+void compressedStreamEOF ( void )
+{
+ if (noisy) {
+ fprintf ( stderr,
+ "\n%s: Compressed file ends unexpectedly;\n\t"
+ "perhaps it is corrupted? *Possible* reason follows.\n",
+ progName );
+ perror ( progName );
+ showFileNames();
+ cadvise();
+ }
+ cleanUpAndFail( 2 );
+}
+
+
+/*---------------------------------------------*/
+static
+void ioError ( void )
+{
+ fprintf ( stderr,
+ "\n%s: I/O or other error, bailing out. "
+ "Possible reason follows.\n",
+ progName );
+ perror ( progName );
+ showFileNames();
+ cleanUpAndFail( 1 );
+}
+
+
+/*---------------------------------------------*/
+static
+void mySignalCatcher ( IntNative n )
+{
+ fprintf ( stderr,
+ "\n%s: Control-C or similar caught, quitting.\n",
+ progName );
+ cleanUpAndFail(1);
+}
+
+
+/*---------------------------------------------*/
+static
+void mySIGSEGVorSIGBUScatcher ( IntNative n )
+{
+ if (opMode == OM_Z)
+ fprintf (
+ stderr,
+ "\n%s: Caught a SIGSEGV or SIGBUS whilst compressing.\n"
+ "\n"
+ " Possible causes are (most likely first):\n"
+ " (1) This computer has unreliable memory or cache hardware\n"
+ " (a surprisingly common problem; try a different machine.)\n"
+ " (2) A bug in the compiler used to create this executable\n"
+ " (unlikely, if you didn't compile bzip2 yourself.)\n"
+ " (3) A real bug in bzip2 -- I hope this should never be the case.\n"
+ " The user's manual, Section 4.3, has more info on (1) and (2).\n"
+ " \n"
+ " If you suspect this is a bug in bzip2, or are unsure about (1)\n"
+ " or (2), feel free to report it to me at: jseward@bzip.org.\n"
+ " Section 4.3 of the user's manual describes the info a useful\n"
+ " bug report should have. If the manual is available on your\n"
+ " system, please try and read it before mailing me. If you don't\n"
+ " have the manual or can't be bothered to read it, mail me anyway.\n"
+ "\n",
+ progName );
+ else
+ fprintf (
+ stderr,
+ "\n%s: Caught a SIGSEGV or SIGBUS whilst decompressing.\n"
+ "\n"
+ " Possible causes are (most likely first):\n"
+ " (1) The compressed data is corrupted, and bzip2's usual checks\n"
+ " failed to detect this. Try bzip2 -tvv my_file.bz2.\n"
+ " (2) This computer has unreliable memory or cache hardware\n"
+ " (a surprisingly common problem; try a different machine.)\n"
+ " (3) A bug in the compiler used to create this executable\n"
+ " (unlikely, if you didn't compile bzip2 yourself.)\n"
+ " (4) A real bug in bzip2 -- I hope this should never be the case.\n"
+ " The user's manual, Section 4.3, has more info on (2) and (3).\n"
+ " \n"
+ " If you suspect this is a bug in bzip2, or are unsure about (2)\n"
+ " or (3), feel free to report it to me at: jseward@bzip.org.\n"
+ " Section 4.3 of the user's manual describes the info a useful\n"
+ " bug report should have. If the manual is available on your\n"
+ " system, please try and read it before mailing me. If you don't\n"
+ " have the manual or can't be bothered to read it, mail me anyway.\n"
+ "\n",
+ progName );
+
+ showFileNames();
+ if (opMode == OM_Z)
+ cleanUpAndFail( 3 ); else
+ { cadvise(); cleanUpAndFail( 2 ); }
+}
+
+
+/*---------------------------------------------*/
+static
+void outOfMemory ( void )
+{
+ fprintf ( stderr,
+ "\n%s: couldn't allocate enough memory\n",
+ progName );
+ showFileNames();
+ cleanUpAndFail(1);
+}
+
+
+/*---------------------------------------------*/
+static
+void configError ( void )
+{
+ fprintf ( stderr,
+ "bzip2: I'm not configured correctly for this platform!\n"
+ "\tI require Int32, Int16 and Char to have sizes\n"
+ "\tof 4, 2 and 1 bytes to run properly, and they don't.\n"
+ "\tProbably you can fix this by defining them correctly,\n"
+ "\tand recompiling. Bye!\n" );
+ setExit(3);
+ exit(exitValue);
+}
+
+
+/*---------------------------------------------------*/
+/*--- The main driver machinery ---*/
+/*---------------------------------------------------*/
+
+/* All rather crufty. The main problem is that input files
+ are stat()d multiple times before use. This should be
+ cleaned up.
+*/
+
+/*---------------------------------------------*/
+static
+void pad ( Char *s )
+{
+ Int32 i;
+ if ( (Int32)strlen(s) >= longestFileName ) return;
+ for (i = 1; i <= longestFileName - (Int32)strlen(s); i++)
+ fprintf ( stderr, " " );
+}
+
+
+/*---------------------------------------------*/
+static
+void copyFileName ( Char* to, Char* from )
+{
+ if ( strlen(from) > FILE_NAME_LEN-10 ) {
+ fprintf (
+ stderr,
+ "bzip2: file name\n`%s'\n"
+ "is suspiciously (more than %d chars) long.\n"
+ "Try using a reasonable file name instead. Sorry! :-)\n",
+ from, FILE_NAME_LEN-10
+ );
+ setExit(1);
+ exit(exitValue);
+ }
+
+ strncpy(to,from,FILE_NAME_LEN-10);
+ to[FILE_NAME_LEN-10]='\0';
+}
+
+
+/*---------------------------------------------*/
+static
+Bool fileExists ( Char* name )
+{
+ FILE *tmp = fopen ( name, "rb" );
+ Bool exists = (tmp != NULL);
+ if (tmp != NULL) fclose ( tmp );
+ return exists;
+}
+
+
+/*---------------------------------------------*/
+/* Open an output file safely with O_EXCL and good permissions.
+ This avoids a race condition in versions < 1.0.2, in which
+ the file was first opened and then had its interim permissions
+ set safely. We instead use open() to create the file with
+ the interim permissions required. (--- --- rw-).
+
+ For non-Unix platforms, if we are not worrying about
+ security issues, simple this simply behaves like fopen.
+*/
+static
+FILE* fopen_output_safely ( Char* name, const char* mode )
+{
+# if BZ_UNIX
+ FILE* fp;
+ IntNative fh;
+ fh = open(name, O_WRONLY|O_CREAT|O_EXCL, S_IWUSR|S_IRUSR);
+ if (fh == -1) return NULL;
+ fp = fdopen(fh, mode);
+ if (fp == NULL) close(fh);
+ return fp;
+# else
+ return fopen(name, mode);
+# endif
+}
+
+
+/*---------------------------------------------*/
+/*--
+ if in doubt, return True
+--*/
+static
+Bool notAStandardFile ( Char* name )
+{
+ IntNative i;
+ struct MY_STAT statBuf;
+
+ i = MY_LSTAT ( name, &statBuf );
+ if (i != 0) return True;
+ if (MY_S_ISREG(statBuf.st_mode)) return False;
+ return True;
+}
+
+
+/*---------------------------------------------*/
+/*--
+ rac 11/21/98 see if file has hard links to it
+--*/
+static
+Int32 countHardLinks ( Char* name )
+{
+ IntNative i;
+ struct MY_STAT statBuf;
+
+ i = MY_LSTAT ( name, &statBuf );
+ if (i != 0) return 0;
+ return (statBuf.st_nlink - 1);
+}
+
+
+/*---------------------------------------------*/
+/* Copy modification date, access date, permissions and owner from the
+ source to destination file. We have to copy this meta-info off
+ into fileMetaInfo before starting to compress / decompress it,
+ because doing it afterwards means we get the wrong access time.
+
+ To complicate matters, in compress() and decompress() below, the
+ sequence of tests preceding the call to saveInputFileMetaInfo()
+ involves calling fileExists(), which in turn establishes its result
+ by attempting to fopen() the file, and if successful, immediately
+ fclose()ing it again. So we have to assume that the fopen() call
+ does not cause the access time field to be updated.
+
+ Reading of the man page for stat() (man 2 stat) on RedHat 7.2 seems
+ to imply that merely doing open() will not affect the access time.
+ Therefore we merely need to hope that the C library only does
+ open() as a result of fopen(), and not any kind of read()-ahead
+ cleverness.
+
+ It sounds pretty fragile to me. Whether this carries across
+ robustly to arbitrary Unix-like platforms (or even works robustly
+ on this one, RedHat 7.2) is unknown to me. Nevertheless ...
+*/
+#if BZ_UNIX
+static
+struct MY_STAT fileMetaInfo;
+#endif
+
+static
+void saveInputFileMetaInfo ( Char *srcName )
+{
+# if BZ_UNIX
+ IntNative retVal;
+ /* Note use of stat here, not lstat. */
+ retVal = MY_STAT( srcName, &fileMetaInfo );
+ ERROR_IF_NOT_ZERO ( retVal );
+# endif
+}
+
+
+static
+void applySavedTimeInfoToOutputFile ( Char *dstName )
+{
+# if BZ_UNIX
+ IntNative retVal;
+ struct utimbuf uTimBuf;
+
+ uTimBuf.actime = fileMetaInfo.st_atime;
+ uTimBuf.modtime = fileMetaInfo.st_mtime;
+
+ retVal = utime ( dstName, &uTimBuf );
+ ERROR_IF_NOT_ZERO ( retVal );
+# endif
+}
+
+static
+void applySavedFileAttrToOutputFile ( IntNative fd )
+{
+# if BZ_UNIX
+ IntNative retVal;
+
+ retVal = fchmod ( fd, fileMetaInfo.st_mode );
+ ERROR_IF_NOT_ZERO ( retVal );
+
+ (void) fchown ( fd, fileMetaInfo.st_uid, fileMetaInfo.st_gid );
+ /* chown() will in many cases return with EPERM, which can
+ be safely ignored.
+ */
+# endif
+}
+
+
+/*---------------------------------------------*/
+static
+Bool containsDubiousChars ( Char* name )
+{
+# if BZ_UNIX
+ /* On unix, files can contain any characters and the file expansion
+ * is performed by the shell.
+ */
+ return False;
+# else /* ! BZ_UNIX */
+ /* On non-unix (Win* platforms), wildcard characters are not allowed in
+ * filenames.
+ */
+ for (; *name != '\0'; name++)
+ if (*name == '?' || *name == '*') return True;
+ return False;
+# endif /* BZ_UNIX */
+}
+
+
+/*---------------------------------------------*/
+#define BZ_N_SUFFIX_PAIRS 4
+
+const Char* zSuffix[BZ_N_SUFFIX_PAIRS]
+ = { ".bz2", ".bz", ".tbz2", ".tbz" };
+const Char* unzSuffix[BZ_N_SUFFIX_PAIRS]
+ = { "", "", ".tar", ".tar" };
+
+static
+Bool hasSuffix ( Char* s, const Char* suffix )
+{
+ Int32 ns = strlen(s);
+ Int32 nx = strlen(suffix);
+ if (ns < nx) return False;
+ if (strcmp(s + ns - nx, suffix) == 0) return True;
+ return False;
+}
+
+static
+Bool mapSuffix ( Char* name,
+ const Char* oldSuffix,
+ const Char* newSuffix )
+{
+ if (!hasSuffix(name,oldSuffix)) return False;
+ name[strlen(name)-strlen(oldSuffix)] = 0;
+ strcat ( name, newSuffix );
+ return True;
+}
+
+
+/*---------------------------------------------*/
+static
+void compress ( Char *name )
+{
+ FILE *inStr = NULL;
+ FILE *outStr = NULL;
+ Int32 n, i;
+ struct MY_STAT statBuf;
+
+ deleteOutputOnInterrupt = False;
+
+ if (name == NULL && srcMode != SM_I2O)
+ panic ( "compress: bad modes\n" );
+
+ switch (srcMode) {
+ case SM_I2O:
+ copyFileName ( inName, (Char*)"(stdin)" );
+ copyFileName ( outName, (Char*)"(stdout)" );
+ break;
+ case SM_F2F:
+ copyFileName ( inName, name );
+ copyFileName ( outName, name );
+ strcat ( outName, ".bz2" );
+ break;
+ case SM_F2O:
+ copyFileName ( inName, name );
+ copyFileName ( outName, (Char*)"(stdout)" );
+ break;
+ }
+
+ if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
+ if (noisy)
+ fprintf ( stderr, "%s: There are no files matching `%s'.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ }
+ for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) {
+ if (hasSuffix(inName, zSuffix[i])) {
+ if (noisy)
+ fprintf ( stderr,
+ "%s: Input file %s already has %s suffix.\n",
+ progName, inName, zSuffix[i] );
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F || srcMode == SM_F2O ) {
+ MY_STAT(inName, &statBuf);
+ if ( MY_S_ISDIR(statBuf.st_mode) ) {
+ fprintf( stderr,
+ "%s: Input file %s is a directory.\n",
+ progName,inName);
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) {
+ if (noisy)
+ fprintf ( stderr, "%s: Input file %s is not a normal file.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( srcMode == SM_F2F && fileExists ( outName ) ) {
+ if (forceOverwrite) {
+ remove(outName);
+ } else {
+ fprintf ( stderr, "%s: Output file %s already exists.\n",
+ progName, outName );
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F && !forceOverwrite &&
+ (n=countHardLinks ( inName )) > 0) {
+ fprintf ( stderr, "%s: Input file %s has %d other link%s.\n",
+ progName, inName, n, n > 1 ? "s" : "" );
+ setExit(1);
+ return;
+ }
+
+ if ( srcMode == SM_F2F ) {
+ /* Save the file's meta-info before we open it. Doing it later
+ means we mess up the access times. */
+ saveInputFileMetaInfo ( inName );
+ }
+
+ switch ( srcMode ) {
+
+ case SM_I2O:
+ inStr = stdin;
+ outStr = stdout;
+ if ( isatty ( fileno ( stdout ) ) ) {
+ fprintf ( stderr,
+ "%s: I won't write compressed data to a terminal.\n",
+ progName );
+ fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
+ progName, progName );
+ setExit(1);
+ return;
+ };
+ break;
+
+ case SM_F2O:
+ inStr = fopen ( inName, "rb" );
+ outStr = stdout;
+ if ( isatty ( fileno ( stdout ) ) ) {
+ fprintf ( stderr,
+ "%s: I won't write compressed data to a terminal.\n",
+ progName );
+ fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
+ progName, progName );
+ if ( inStr != NULL ) fclose ( inStr );
+ setExit(1);
+ return;
+ };
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ };
+ break;
+
+ case SM_F2F:
+ inStr = fopen ( inName, "rb" );
+ outStr = fopen_output_safely ( outName, "wb" );
+ if ( outStr == NULL) {
+ fprintf ( stderr, "%s: Can't create output file %s: %s.\n",
+ progName, outName, strerror(errno) );
+ if ( inStr != NULL ) fclose ( inStr );
+ setExit(1);
+ return;
+ }
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ if ( outStr != NULL ) fclose ( outStr );
+ setExit(1);
+ return;
+ };
+ break;
+
+ default:
+ panic ( "compress: bad srcMode" );
+ break;
+ }
+
+ if (verbosity >= 1) {
+ fprintf ( stderr, " %s: ", inName );
+ pad ( inName );
+ fflush ( stderr );
+ }
+
+ /*--- Now the input and output handles are sane. Do the Biz. ---*/
+ outputHandleJustInCase = outStr;
+ deleteOutputOnInterrupt = True;
+ compressStream ( inStr, outStr );
+ outputHandleJustInCase = NULL;
+
+ /*--- If there was an I/O error, we won't get here. ---*/
+ if ( srcMode == SM_F2F ) {
+ applySavedTimeInfoToOutputFile ( outName );
+ deleteOutputOnInterrupt = False;
+ if ( !keepInputFiles ) {
+ IntNative retVal = remove ( inName );
+ ERROR_IF_NOT_ZERO ( retVal );
+ }
+ }
+
+ deleteOutputOnInterrupt = False;
+}
+
+
+/*---------------------------------------------*/
+static
+void uncompress ( Char *name )
+{
+ FILE *inStr = NULL;
+ FILE *outStr = NULL;
+ Int32 n, i;
+ Bool magicNumberOK;
+ Bool cantGuess;
+ struct MY_STAT statBuf;
+
+ deleteOutputOnInterrupt = False;
+
+ if (name == NULL && srcMode != SM_I2O)
+ panic ( "uncompress: bad modes\n" );
+
+ cantGuess = False;
+ switch (srcMode) {
+ case SM_I2O:
+ copyFileName ( inName, (Char*)"(stdin)" );
+ copyFileName ( outName, (Char*)"(stdout)" );
+ break;
+ case SM_F2F:
+ copyFileName ( inName, name );
+ copyFileName ( outName, name );
+ for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++)
+ if (mapSuffix(outName,zSuffix[i],unzSuffix[i]))
+ goto zzz;
+ cantGuess = True;
+ strcat ( outName, ".out" );
+ break;
+ case SM_F2O:
+ copyFileName ( inName, name );
+ copyFileName ( outName, (Char*)"(stdout)" );
+ break;
+ }
+
+ zzz:
+ if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
+ if (noisy)
+ fprintf ( stderr, "%s: There are no files matching `%s'.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ }
+ if ( srcMode == SM_F2F || srcMode == SM_F2O ) {
+ MY_STAT(inName, &statBuf);
+ if ( MY_S_ISDIR(statBuf.st_mode) ) {
+ fprintf( stderr,
+ "%s: Input file %s is a directory.\n",
+ progName,inName);
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) {
+ if (noisy)
+ fprintf ( stderr, "%s: Input file %s is not a normal file.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( /* srcMode == SM_F2F implied && */ cantGuess ) {
+ if (noisy)
+ fprintf ( stderr,
+ "%s: Can't guess original name for %s -- using %s\n",
+ progName, inName, outName );
+ /* just a warning, no return */
+ }
+ if ( srcMode == SM_F2F && fileExists ( outName ) ) {
+ if (forceOverwrite) {
+ remove(outName);
+ } else {
+ fprintf ( stderr, "%s: Output file %s already exists.\n",
+ progName, outName );
+ setExit(1);
+ return;
+ }
+ }
+ if ( srcMode == SM_F2F && !forceOverwrite &&
+ (n=countHardLinks ( inName ) ) > 0) {
+ fprintf ( stderr, "%s: Input file %s has %d other link%s.\n",
+ progName, inName, n, n > 1 ? "s" : "" );
+ setExit(1);
+ return;
+ }
+
+ if ( srcMode == SM_F2F ) {
+ /* Save the file's meta-info before we open it. Doing it later
+ means we mess up the access times. */
+ saveInputFileMetaInfo ( inName );
+ }
+
+ switch ( srcMode ) {
+
+ case SM_I2O:
+ inStr = stdin;
+ outStr = stdout;
+ if ( isatty ( fileno ( stdin ) ) ) {
+ fprintf ( stderr,
+ "%s: I won't read compressed data from a terminal.\n",
+ progName );
+ fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
+ progName, progName );
+ setExit(1);
+ return;
+ };
+ break;
+
+ case SM_F2O:
+ inStr = fopen ( inName, "rb" );
+ outStr = stdout;
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s:%s.\n",
+ progName, inName, strerror(errno) );
+ if ( inStr != NULL ) fclose ( inStr );
+ setExit(1);
+ return;
+ };
+ break;
+
+ case SM_F2F:
+ inStr = fopen ( inName, "rb" );
+ outStr = fopen_output_safely ( outName, "wb" );
+ if ( outStr == NULL) {
+ fprintf ( stderr, "%s: Can't create output file %s: %s.\n",
+ progName, outName, strerror(errno) );
+ if ( inStr != NULL ) fclose ( inStr );
+ setExit(1);
+ return;
+ }
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
+ progName, inName, strerror(errno) );
+ if ( outStr != NULL ) fclose ( outStr );
+ setExit(1);
+ return;
+ };
+ break;
+
+ default:
+ panic ( "uncompress: bad srcMode" );
+ break;
+ }
+
+ if (verbosity >= 1) {
+ fprintf ( stderr, " %s: ", inName );
+ pad ( inName );
+ fflush ( stderr );
+ }
+
+ /*--- Now the input and output handles are sane. Do the Biz. ---*/
+ outputHandleJustInCase = outStr;
+ deleteOutputOnInterrupt = True;
+ magicNumberOK = uncompressStream ( inStr, outStr );
+ outputHandleJustInCase = NULL;
+
+ /*--- If there was an I/O error, we won't get here. ---*/
+ if ( magicNumberOK ) {
+ if ( srcMode == SM_F2F ) {
+ applySavedTimeInfoToOutputFile ( outName );
+ deleteOutputOnInterrupt = False;
+ if ( !keepInputFiles ) {
+ IntNative retVal = remove ( inName );
+ ERROR_IF_NOT_ZERO ( retVal );
+ }
+ }
+ } else {
+ unzFailsExist = True;
+ deleteOutputOnInterrupt = False;
+ if ( srcMode == SM_F2F ) {
+ IntNative retVal = remove ( outName );
+ ERROR_IF_NOT_ZERO ( retVal );
+ }
+ }
+ deleteOutputOnInterrupt = False;
+
+ if ( magicNumberOK ) {
+ if (verbosity >= 1)
+ fprintf ( stderr, "done\n" );
+ } else {
+ setExit(2);
+ if (verbosity >= 1)
+ fprintf ( stderr, "not a bzip2 file.\n" ); else
+ fprintf ( stderr,
+ "%s: %s is not a bzip2 file.\n",
+ progName, inName );
+ }
+
+}
+
+
+/*---------------------------------------------*/
+static
+void testf ( Char *name )
+{
+ FILE *inStr = NULL;
+ Bool allOK;
+ struct MY_STAT statBuf;
+
+ deleteOutputOnInterrupt = False;
+
+ if (name == NULL && srcMode != SM_I2O)
+ panic ( "testf: bad modes\n" );
+
+ copyFileName ( outName, (Char*)"(none)" );
+ switch (srcMode) {
+ case SM_I2O: copyFileName ( inName, (Char*)"(stdin)" ); break;
+ case SM_F2F: copyFileName ( inName, name ); break;
+ case SM_F2O: copyFileName ( inName, name ); break;
+ }
+
+ if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
+ if (noisy)
+ fprintf ( stderr, "%s: There are no files matching `%s'.\n",
+ progName, inName );
+ setExit(1);
+ return;
+ }
+ if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
+ fprintf ( stderr, "%s: Can't open input %s: %s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ }
+ if ( srcMode != SM_I2O ) {
+ MY_STAT(inName, &statBuf);
+ if ( MY_S_ISDIR(statBuf.st_mode) ) {
+ fprintf( stderr,
+ "%s: Input file %s is a directory.\n",
+ progName,inName);
+ setExit(1);
+ return;
+ }
+ }
+
+ switch ( srcMode ) {
+
+ case SM_I2O:
+ if ( isatty ( fileno ( stdin ) ) ) {
+ fprintf ( stderr,
+ "%s: I won't read compressed data from a terminal.\n",
+ progName );
+ fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
+ progName, progName );
+ setExit(1);
+ return;
+ };
+ inStr = stdin;
+ break;
+
+ case SM_F2O: case SM_F2F:
+ inStr = fopen ( inName, "rb" );
+ if ( inStr == NULL ) {
+ fprintf ( stderr, "%s: Can't open input file %s:%s.\n",
+ progName, inName, strerror(errno) );
+ setExit(1);
+ return;
+ };
+ break;
+
+ default:
+ panic ( "testf: bad srcMode" );
+ break;
+ }
+
+ if (verbosity >= 1) {
+ fprintf ( stderr, " %s: ", inName );
+ pad ( inName );
+ fflush ( stderr );
+ }
+
+ /*--- Now the input handle is sane. Do the Biz. ---*/
+ outputHandleJustInCase = NULL;
+ allOK = testStream ( inStr );
+
+ if (allOK && verbosity >= 1) fprintf ( stderr, "ok\n" );
+ if (!allOK) testFailsExist = True;
+}
+
+
+/*---------------------------------------------*/
+static
+void license ( void )
+{
+ fprintf ( stderr,
+
+ "bzip2, a block-sorting file compressor. "
+ "Version %s.\n"
+ " \n"
+ " Copyright (C) 1996-2010 by Julian Seward.\n"
+ " \n"
+ " This program is free software; you can redistribute it and/or modify\n"
+ " it under the terms set out in the LICENSE file, which is included\n"
+ " in the bzip2-1.0.6 source distribution.\n"
+ " \n"
+ " This program is distributed in the hope that it will be useful,\n"
+ " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+ " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
+ " LICENSE file for more details.\n"
+ " \n",
+ BZ2_bzlibVersion()
+ );
+}
+
+
+/*---------------------------------------------*/
+static
+void usage ( Char *fullProgName )
+{
+ fprintf (
+ stderr,
+ "bzip2, a block-sorting file compressor. "
+ "Version %s.\n"
+ "\n usage: %s [flags and input files in any order]\n"
+ "\n"
+ " -h --help print this message\n"
+ " -d --decompress force decompression\n"
+ " -z --compress force compression\n"
+ " -k --keep keep (don't delete) input files\n"
+ " -f --force overwrite existing output files\n"
+ " -t --test test compressed file integrity\n"
+ " -c --stdout output to standard out\n"
+ " -q --quiet suppress noncritical error messages\n"
+ " -v --verbose be verbose (a 2nd -v gives more)\n"
+ " -L --license display software version & license\n"
+ " -V --version display software version & license\n"
+ " -s --small use less memory (at most 2500k)\n"
+ " -1 .. -9 set block size to 100k .. 900k\n"
+ " --fast alias for -1\n"
+ " --best alias for -9\n"
+ "\n"
+ " If invoked as `bzip2', default action is to compress.\n"
+ " as `bunzip2', default action is to decompress.\n"
+ " as `bzcat', default action is to decompress to stdout.\n"
+ "\n"
+ " If no file names are given, bzip2 compresses or decompresses\n"
+ " from standard input to standard output. You can combine\n"
+ " short flags, so `-v -4' means the same as -v4 or -4v, &c.\n"
+# if BZ_UNIX
+ "\n"
+# endif
+ ,
+
+ BZ2_bzlibVersion(),
+ fullProgName
+ );
+}
+
+
+/*---------------------------------------------*/
+static
+void redundant ( Char* flag )
+{
+ fprintf (
+ stderr,
+ "%s: %s is redundant in versions 0.9.5 and above\n",
+ progName, flag );
+}
+
+
+/*---------------------------------------------*/
+/*--
+ All the garbage from here to main() is purely to
+ implement a linked list of command-line arguments,
+ into which main() copies argv[1 .. argc-1].
+
+ The purpose of this exercise is to facilitate
+ the expansion of wildcard characters * and ? in
+ filenames for OSs which don't know how to do it
+ themselves, like MSDOS, Windows 95 and NT.
+
+ The actual Dirty Work is done by the platform-
+ specific macro APPEND_FILESPEC.
+--*/
+
+typedef
+ struct zzzz {
+ Char *name;
+ struct zzzz *link;
+ }
+ Cell;
+
+
+/*---------------------------------------------*/
+static
+void *myMalloc ( Int32 n )
+{
+ void* p;
+
+ p = malloc ( (size_t)n );
+ if (p == NULL) outOfMemory ();
+ return p;
+}
+
+
+/*---------------------------------------------*/
+static
+Cell *mkCell ( void )
+{
+ Cell *c;
+
+ c = (Cell*) myMalloc ( sizeof ( Cell ) );
+ c->name = NULL;
+ c->link = NULL;
+ return c;
+}
+
+
+/*---------------------------------------------*/
+static
+Cell *snocString ( Cell *root, Char *name )
+{
+ if (root == NULL) {
+ Cell *tmp = mkCell();
+ tmp->name = (Char*) myMalloc ( 5 + strlen(name) );
+ strcpy ( tmp->name, name );
+ return tmp;
+ } else {
+ Cell *tmp = root;
+ while (tmp->link != NULL) tmp = tmp->link;
+ tmp->link = snocString ( tmp->link, name );
+ return root;
+ }
+}
+
+
+/*---------------------------------------------*/
+static
+void addFlagsFromEnvVar ( Cell** argList, Char* varName )
+{
+ Int32 i, j, k;
+ Char *envbase, *p;
+
+ envbase = getenv(varName);
+ if (envbase != NULL) {
+ p = envbase;
+ i = 0;
+ while (True) {
+ if (p[i] == 0) break;
+ p += i;
+ i = 0;
+ while (isspace((Int32)(p[0]))) p++;
+ while (p[i] != 0 && !isspace((Int32)(p[i]))) i++;
+ if (i > 0) {
+ k = i; if (k > FILE_NAME_LEN-10) k = FILE_NAME_LEN-10;
+ for (j = 0; j < k; j++) tmpName[j] = p[j];
+ tmpName[k] = 0;
+ APPEND_FLAG(*argList, tmpName);
+ }
+ }
+ }
+}
+
+
+/*---------------------------------------------*/
+#define ISFLAG(s) (strcmp(aa->name, (s))==0)
+
+IntNative main ( IntNative argc, Char *argv[] )
+{
+ Int32 i, j;
+ Char *tmp;
+ Cell *argList;
+ Cell *aa;
+ Bool decode;
+
+ /*-- Be really really really paranoid :-) --*/
+ if (sizeof(Int32) != 4 || sizeof(UInt32) != 4 ||
+ sizeof(Int16) != 2 || sizeof(UInt16) != 2 ||
+ sizeof(Char) != 1 || sizeof(UChar) != 1)
+ configError();
+
+ /*-- Initialise --*/
+ outputHandleJustInCase = NULL;
+ smallMode = False;
+ keepInputFiles = False;
+ forceOverwrite = False;
+ noisy = True;
+ verbosity = 0;
+ blockSize100k = 9;
+ testFailsExist = False;
+ unzFailsExist = False;
+ numFileNames = 0;
+ numFilesProcessed = 0;
+ workFactor = 30;
+ deleteOutputOnInterrupt = False;
+ exitValue = 0;
+ i = j = 0; /* avoid bogus warning from egcs-1.1.X */
+
+ /*-- Set up signal handlers for mem access errors --*/
+ signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
+# if BZ_UNIX
+# ifndef __DJGPP__
+ signal (SIGBUS, mySIGSEGVorSIGBUScatcher);
+# endif
+# endif
+
+ copyFileName ( inName, (Char*)"(none)" );
+ copyFileName ( outName, (Char*)"(none)" );
+
+ copyFileName ( progNameReally, argv[0] );
+ progName = &progNameReally[0];
+ for (tmp = &progNameReally[0]; *tmp != '\0'; tmp++)
+ if (*tmp == PATH_SEP) progName = tmp + 1;
+
+
+ /*-- Copy flags from env var BZIP2, and
+ expand filename wildcards in arg list.
+ --*/
+ argList = NULL;
+ addFlagsFromEnvVar ( &argList, (Char*)"BZIP2" );
+ addFlagsFromEnvVar ( &argList, (Char*)"BZIP" );
+ for (i = 1; i <= argc-1; i++)
+ APPEND_FILESPEC(argList, argv[i]);
+
+
+ /*-- Find the length of the longest filename --*/
+ longestFileName = 7;
+ numFileNames = 0;
+ decode = True;
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) { decode = False; continue; }
+ if (aa->name[0] == '-' && decode) continue;
+ numFileNames++;
+ if (longestFileName < (Int32)strlen(aa->name) )
+ longestFileName = (Int32)strlen(aa->name);
+ }
+
+
+ /*-- Determine source modes; flag handling may change this too. --*/
+ if (numFileNames == 0)
+ srcMode = SM_I2O; else srcMode = SM_F2F;
+
+
+ /*-- Determine what to do (compress/uncompress/test/cat). --*/
+ /*-- Note that subsequent flag handling may change this. --*/
+ opMode = OM_Z;
+
+ if ( (strstr ( progName, "unzip" ) != 0) ||
+ (strstr ( progName, "UNZIP" ) != 0) )
+ opMode = OM_UNZ;
+
+ if ( (strstr ( progName, "z2cat" ) != 0) ||
+ (strstr ( progName, "Z2CAT" ) != 0) ||
+ (strstr ( progName, "zcat" ) != 0) ||
+ (strstr ( progName, "ZCAT" ) != 0) ) {
+ opMode = OM_UNZ;
+ srcMode = (numFileNames == 0) ? SM_I2O : SM_F2O;
+ }
+
+
+ /*-- Look at the flags. --*/
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) break;
+ if (aa->name[0] == '-' && aa->name[1] != '-') {
+ for (j = 1; aa->name[j] != '\0'; j++) {
+ switch (aa->name[j]) {
+ case 'c': srcMode = SM_F2O; break;
+ case 'd': opMode = OM_UNZ; break;
+ case 'z': opMode = OM_Z; break;
+ case 'f': forceOverwrite = True; break;
+ case 't': opMode = OM_TEST; break;
+ case 'k': keepInputFiles = True; break;
+ case 's': smallMode = True; break;
+ case 'q': noisy = False; break;
+ case '1': blockSize100k = 1; break;
+ case '2': blockSize100k = 2; break;
+ case '3': blockSize100k = 3; break;
+ case '4': blockSize100k = 4; break;
+ case '5': blockSize100k = 5; break;
+ case '6': blockSize100k = 6; break;
+ case '7': blockSize100k = 7; break;
+ case '8': blockSize100k = 8; break;
+ case '9': blockSize100k = 9; break;
+ case 'V':
+ case 'L': license(); break;
+ case 'v': verbosity++; break;
+ case 'h': usage ( progName );
+ exit ( 0 );
+ break;
+ default: fprintf ( stderr, "%s: Bad flag `%s'\n",
+ progName, aa->name );
+ usage ( progName );
+ exit ( 1 );
+ break;
+ }
+ }
+ }
+ }
+
+ /*-- And again ... --*/
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) break;
+ if (ISFLAG("--stdout")) srcMode = SM_F2O; else
+ if (ISFLAG("--decompress")) opMode = OM_UNZ; else
+ if (ISFLAG("--compress")) opMode = OM_Z; else
+ if (ISFLAG("--force")) forceOverwrite = True; else
+ if (ISFLAG("--test")) opMode = OM_TEST; else
+ if (ISFLAG("--keep")) keepInputFiles = True; else
+ if (ISFLAG("--small")) smallMode = True; else
+ if (ISFLAG("--quiet")) noisy = False; else
+ if (ISFLAG("--version")) license(); else
+ if (ISFLAG("--license")) license(); else
+ if (ISFLAG("--exponential")) workFactor = 1; else
+ if (ISFLAG("--repetitive-best")) redundant(aa->name); else
+ if (ISFLAG("--repetitive-fast")) redundant(aa->name); else
+ if (ISFLAG("--fast")) blockSize100k = 1; else
+ if (ISFLAG("--best")) blockSize100k = 9; else
+ if (ISFLAG("--verbose")) verbosity++; else
+ if (ISFLAG("--help")) { usage ( progName ); exit ( 0 ); }
+ else
+ if (strncmp ( aa->name, "--", 2) == 0) {
+ fprintf ( stderr, "%s: Bad flag `%s'\n", progName, aa->name );
+ usage ( progName );
+ exit ( 1 );
+ }
+ }
+
+ if (verbosity > 4) verbosity = 4;
+ if (opMode == OM_Z && smallMode && blockSize100k > 2)
+ blockSize100k = 2;
+
+ if (opMode == OM_TEST && srcMode == SM_F2O) {
+ fprintf ( stderr, "%s: -c and -t cannot be used together.\n",
+ progName );
+ exit ( 1 );
+ }
+
+ if (srcMode == SM_F2O && numFileNames == 0)
+ srcMode = SM_I2O;
+
+ if (opMode != OM_Z) blockSize100k = 0;
+
+ if (srcMode == SM_F2F) {
+ signal (SIGINT, mySignalCatcher);
+ signal (SIGTERM, mySignalCatcher);
+# if BZ_UNIX
+ signal (SIGHUP, mySignalCatcher);
+# endif
+ }
+
+ if (opMode == OM_Z) {
+ if (srcMode == SM_I2O) {
+ compress ( NULL );
+ } else {
+ decode = True;
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) { decode = False; continue; }
+ if (aa->name[0] == '-' && decode) continue;
+ numFilesProcessed++;
+ compress ( aa->name );
+ }
+ }
+ }
+ else
+
+ if (opMode == OM_UNZ) {
+ unzFailsExist = False;
+ if (srcMode == SM_I2O) {
+ uncompress ( NULL );
+ } else {
+ decode = True;
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) { decode = False; continue; }
+ if (aa->name[0] == '-' && decode) continue;
+ numFilesProcessed++;
+ uncompress ( aa->name );
+ }
+ }
+ if (unzFailsExist) {
+ setExit(2);
+ exit(exitValue);
+ }
+ }
+
+ else {
+ testFailsExist = False;
+ if (srcMode == SM_I2O) {
+ testf ( NULL );
+ } else {
+ decode = True;
+ for (aa = argList; aa != NULL; aa = aa->link) {
+ if (ISFLAG("--")) { decode = False; continue; }
+ if (aa->name[0] == '-' && decode) continue;
+ numFilesProcessed++;
+ testf ( aa->name );
+ }
+ }
+ if (testFailsExist && noisy) {
+ fprintf ( stderr,
+ "\n"
+ "You can use the `bzip2recover' program to attempt to recover\n"
+ "data from undamaged sections of corrupted files.\n\n"
+ );
+ setExit(2);
+ exit(exitValue);
+ }
+ }
+
+ /* Free the argument list memory to mollify leak detectors
+ (eg) Purify, Checker. Serves no other useful purpose.
+ */
+ aa = argList;
+ while (aa != NULL) {
+ Cell* aa2 = aa->link;
+ if (aa->name != NULL) free(aa->name);
+ free(aa);
+ aa = aa2;
+ }
+
+ return exitValue;
+}
+
+
+/*-----------------------------------------------------------*/
+/*--- end bzip2.c ---*/
+/*-----------------------------------------------------------*/
diff --git bzip2-1.0.6/configure.ac bzip2-1.0.6/configure.ac
new file mode 100644
index 0000000..0cb59b5
--- /dev/null
+++ bzip2-1.0.6/configure.ac
@@ -0,0 +1,39 @@
+AC_INIT([bzip2],[1.0.6])
+# ------------------------------------------------------------------
+# This file is part of bzip2/libbzip2, a program and library for
+# lossless, block-sorting data compression.
+#
+# bzip2/libbzip2 version 1.0.6 of 6 September 2010
+# Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
+#
+# File: configure.ac for autoconf configuration
+# Contributed by Keith Marshall <keithmarshall@users.sourceforge.net>
+#
+# Please read the WARNING, DISCLAIMER and PATENTS sections in the
+# README file.
+#
+# This program is released under the terms of the license contained
+# in the file LICENSE.
+# ------------------------------------------------------------------
+AC_PROG_CC
+AC_PROG_LN_S
+
+BZIP2_AC_ENABLE_SHARED
+BZIP2_AC_SUBST_DLLVER
+BZIP2_AC_SUBST_DLLNAME
+
+AC_ARG_VAR([AR],[Archive librarian command])
+AC_ARG_VAR([ARFLAGS],[Archive librarian control flags, e.g. cq])
+AC_ARG_VAR([RANLIB],[Archive library indexing command])
+
+AC_CHECK_TOOL([AR],[ar],[ar])
+AC_CHECK_TOOL([RANLIB],[ranlib],[true])
+
+AC_MSG_CHECKING([for flags to pass to ${AR}])
+AC_SUBST([ARFLAGS],[${ARFLAGS-cq}])
+AC_MSG_RESULT([${ARFLAGS}])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+
+# configure.ac: end of file
diff --git bzip2-1.0.6/cygwin-bzip2-1.0.6-src.patch bzip2-1.0.6/cygwin-bzip2-1.0.6-src.patch
new file mode 100644
index 0000000..b8ced1d
--- /dev/null
+++ bzip2-1.0.6/cygwin-bzip2-1.0.6-src.patch
@@ -0,0 +1,511 @@
+diff --git a/bzip2-1.0.6/bzgrep b/bzip2-1.0.6/bzgrep
+index 9a04b83..37de592 100644
+--- a/bzip2-1.0.6/bzgrep
++++ b/bzip2-1.0.6/bzgrep
+@@ -1,27 +1,75 @@
+ #!/bin/sh
+
+-# Bzgrep wrapped for bzip2,
+-# adapted from zgrep by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
+-## zgrep notice:
+-## zgrep -- a wrapper around a grep program that decompresses files as needed
+-## Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
++# bzgrep -- a wrapper around a grep program that decompresses files as needed
++# Adapted from zgrep of the Debian gzip package by Anibal Monsalve Salazar.
++# Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
++
++# Copyright (C) 1998, 2001, 2002 Free Software Foundation
++# Copyright (C) 1993 Jean-loup Gailly
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
+
+ PATH="/usr/bin:$PATH"; export PATH
+
+-prog=`echo $0 | sed 's|.*/||'`
++prog=`echo "$0" | sed 's|.*/||'`
+ case "$prog" in
+ *egrep) grep=${EGREP-egrep} ;;
+ *fgrep) grep=${FGREP-fgrep} ;;
+ *) grep=${GREP-grep} ;;
+ esac
++
+ pat=""
++after_dash_dash=""
++files_with_matches=0
++files_without_matches=0
++no_filename=0
++with_filename=0
++
+ while test $# -ne 0; do
+- case "$1" in
+- -e | -f) opt="$opt $1"; shift; pat="$1"
++ case "$after_dash_dash$1" in
++ --d* | --rec*) echo >&2 "$0: $1: option not supported"; exit 2;;
++ --files-with-*) files_with_matches=1;;
++ --files-witho*) files_without_matches=1;;
++ --no-f*) no_filename=1;;
++ --wi*) with_filename=1;;
++ --*) ;;
++ -*)
++ case "$1" in
++ -*[dr]*) echo >&2 "$0: $1: option not supported"; exit 2;;
++ esac
++ case "$1" in
++ -*H*) with_filename=1;;
++ esac
++ case "$1" in
++ -*h*) no_filename=1;;
++ esac
++ case "$1" in
++ -*L*) files_without_matches=1;;
++ esac
++ case "$1" in
++ -*l*) files_with_matches=1;;
++ esac;;
++ esac
++ case "$after_dash_dash$1" in
++ -[ef]) opt="$opt $1"; shift; pat="$1"
+ if test "$grep" = grep; then # grep is buggy with -e on SVR4
+ grep=egrep
+ fi;;
+- -A | -B) opt="$opt $1 $2"; shift;;
++ -[ABCdm])opt="$opt $1 $2"; shift;;
++ --) opt="$opt $1"; after_dash_dash=1;;
+ -*) opt="$opt $1";;
+ *) if test -z "$pat"; then
+ pat="$1"
+@@ -35,19 +83,9 @@ done
+ if test -z "$pat"; then
+ echo "grep through bzip2 files"
+ echo "usage: $prog [grep_options] pattern [files]"
+- exit 1
++ exit 2
+ fi
+
+-list=0
+-silent=0
+-op=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
+-case "$op" in
+- *l*) list=1
+-esac
+-case "$op" in
+- *h*) silent=1
+-esac
+-
+ if test $# -eq 0; then
+ bzip2 -cdfq | $grep $opt "$pat"
+ exit $?
+@@ -55,21 +93,40 @@ fi
+
+ res=0
+ for i do
+- if test -f "$i"; then :; else if test -f "$i.bz2"; then i="$i.bz2"; fi; fi
+- if test $list -eq 1; then
+- bzip2 -cdfq "$i" | $grep $opt "$pat" 2>&1 > /dev/null && echo $i
+- r=$?
+- elif test $# -eq 1 -o $silent -eq 1; then
+- bzip2 -cdfq "$i" | $grep $opt "$pat"
+- r=$?
+- else
+- j=${i//\\/\\\\}
+- j=${j//|/\\|}
+- j=${j//&/\\&}
+- j=`printf "%s" "$j" | tr '\n' ' '`
+- bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
+- r=$?
+- fi
+- test "$r" -ne 0 && res="$r"
++ bzip2 -cdfq -- "$i" |
++ if test $files_with_matches -eq 1; then
++ $grep $opt "$pat" > /dev/null && printf "%s\n" "$i"
++ elif test $files_without_matches -eq 1; then
++ $grep $opt "$pat" > /dev/null || printf "%s\n" "$i"
++ elif test $with_filename -eq 0 && { test $# -eq 1 || test $no_filename -eq 1; }; then
++ $grep $opt "$pat"
++ else
++ i=$(echo "$i" | sed -e 's/[\\|&]/\\&/g')
++ if test $with_filename -eq 1; then
++ sed_script="s|^[^:]*:|${i}:|"
++ else
++ sed_script="s|^|${i}:|"
++ fi
++ # Hack adapted from GPLed code at
++ # http://home.comcast.net/~j.p.h/cus-faq-2
++ # Has the same effect as the following two lines of bash:
++ #
++ # $grep $opt "$pat" | sed "$sed_script"
++ # exit ${PIPESTATUS[0]}
++ #
++ # Inside the `...`, fd4 goes to the pipe whose other end is read
++ # and passed to eval; fd1 is the normal standard output
++ # preserved the line before with exec 3>&1
++ exec 3>&1
++ eval `
++ exec 4>&1 >&3 3>&-
++ {
++ $grep $opt "$pat" 4>&-; echo "r=$?;" >&4
++ } | sed "$sed_script"
++ `
++ exit $r
++ fi
++ r=$?
++ test $res -lt $r && res=$r
+ done
+ exit $res
+diff --git a/bzip2-1.0.6/bzip2.1 b/bzip2-1.0.6/bzip2.1
+index ce3a78e..5302bd7 100644
+--- a/bzip2-1.0.6/bzip2.1
++++ b/bzip2-1.0.6/bzip2.1
+@@ -235,6 +235,10 @@ less), use \-s for everything. See MEMORY MANAGEMENT below.
+ Suppress non-essential warning messages. Messages pertaining to
+ I/O errors and other critical events will not be suppressed.
+ .TP
++.B \-p \-\-show\-progress
++Show percentage of input\-file done and while compressing show the percentage
++of the original file the new file is.
++.TP
+ .B \-v --verbose
+ Verbose mode -- show the compression ratio for each file processed.
+ Further \-v's increase the verbosity level, spewing out lots of
+diff --git a/bzip2-1.0.6/bzip2.c b/bzip2-1.0.6/bzip2.c
+index 6de9d1d..cdda5d2 100644
+--- a/bzip2-1.0.6/bzip2.c
++++ b/bzip2-1.0.6/bzip2.c
+@@ -53,6 +53,7 @@
+ #include <signal.h>
+ #include <math.h>
+ #include <errno.h>
++#include <time.h>
+ #include <ctype.h>
+ #include "bzlib.h"
+
+@@ -128,7 +129,7 @@
+ #if BZ_LCCWIN32
+ # include <io.h>
+ # include <fcntl.h>
+-# include <sys\stat.h>
++# include <sys/stat.h>
+
+ # define NORETURN /**/
+ # define PATH_SEP '\\'
+@@ -209,6 +210,7 @@ Char *progName;
+ Char progNameReally[FILE_NAME_LEN];
+ FILE *outputHandleJustInCase;
+ Int32 workFactor;
++Char showProgress;
+
+ static void panic ( const Char* ) NORETURN;
+ static void ioError ( void ) NORETURN;
+@@ -334,6 +336,12 @@ void compressStream ( FILE *stream, FILE *zStream )
+ UInt32 nbytes_in_lo32, nbytes_in_hi32;
+ UInt32 nbytes_out_lo32, nbytes_out_hi32;
+ Int32 bzerr, bzerr_dummy, ret;
++ double fileSize = 0; /* initialized to make the compiler stop crying */
++ /* double because big files might otherwhise give
++ * overflows. not long long since not all compilers
++ * support that one
++ */
++ time_t startTime, currentTime;
+
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+@@ -341,12 +349,21 @@ void compressStream ( FILE *stream, FILE *zStream )
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ (void)fseek(stream, 0, SEEK_END);
++ fileSize = ftello(stream);
++ rewind(stream);
++ if (verbosity >= 1)
++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
++ }
++
+ bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
+ blockSize100k, verbosity, workFactor );
+ if (bzerr != BZ_OK) goto errhandler;
+
+ if (verbosity >= 2) fprintf ( stderr, "\n" );
+
++ time(&startTime);
+ while (True) {
+
+ if (myfeof(stream)) break;
+@@ -355,6 +372,22 @@ void compressStream ( FILE *stream, FILE *zStream )
+ if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
+ if (bzerr != BZ_OK) goto errhandler;
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ time(&currentTime);
++
++ if ((currentTime - startTime) > 1) { /* show progress every 2 seconds */
++ double curInPos = ftello(stream);
++ double curOutPos = ftello(zStream);
++
++ startTime = currentTime;
++
++ fprintf(stderr, "%.2f%% done", (curInPos * 100.0) / fileSize);
++ if (srcMode == SM_F2F)
++ fprintf(stderr, ", new size: %.2f%%", (curOutPos * 100.0) / curInPos);
++
++ fprintf(stderr, " \r");
++ }
++ }
+ }
+
+ BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
+@@ -439,6 +472,8 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
+ Int32 nUnused;
+ void* unusedTmpV;
+ UChar* unusedTmp;
++ double fileSize = 0; /* initialized to make the compiler stop crying */
++ time_t startTime, currentTime;
+
+ nUnused = 0;
+ streamNo = 0;
+@@ -446,9 +481,19 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
+ SET_BINARY_MODE(stream);
+ SET_BINARY_MODE(zStream);
+
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ off_t dummy = ftello(zStream);
++ (void)fseeko(zStream, 0, SEEK_END);
++ fileSize = ftello(zStream);
++ (void)fseeko(zStream, dummy, SEEK_SET);
++ if (verbosity >= 1)
++ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
++ }
++
+ if (ferror(stream)) goto errhandler_io;
+ if (ferror(zStream)) goto errhandler_io;
+
++ time(&startTime);
+ while (True) {
+
+ bzf = BZ2_bzReadOpen (
+@@ -464,6 +509,16 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
+ if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
+ fwrite ( obuf, sizeof(UChar), nread, stream );
+ if (ferror(stream)) goto errhandler_io;
++
++ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
++ time(&currentTime);
++ if ((currentTime - startTime) >= 2) {
++ double curInPos = ftello(zStream);
++ startTime = currentTime;
++
++ fprintf(stderr, "%.2f%% done\r", (curInPos * 100.0) / fileSize);
++ }
++ }
+ }
+ if (bzerr != BZ_STREAM_END) goto errhandler;
+
+@@ -1132,8 +1187,8 @@ Bool mapSuffix ( Char* name,
+ static
+ void compress ( Char *name )
+ {
+- FILE *inStr;
+- FILE *outStr;
++ FILE *inStr = NULL;
++ FILE *outStr = NULL;
+ Int32 n, i;
+ struct MY_STAT statBuf;
+
+@@ -1313,8 +1368,8 @@ void compress ( Char *name )
+ static
+ void uncompress ( Char *name )
+ {
+- FILE *inStr;
+- FILE *outStr;
++ FILE *inStr = NULL;
++ FILE *outStr = NULL;
+ Int32 n, i;
+ Bool magicNumberOK;
+ Bool cantGuess;
+@@ -1511,7 +1566,7 @@ void uncompress ( Char *name )
+ static
+ void testf ( Char *name )
+ {
+- FILE *inStr;
++ FILE *inStr = NULL;
+ Bool allOK;
+ struct MY_STAT statBuf;
+
+@@ -1803,6 +1858,7 @@ IntNative main ( IntNative argc, Char *argv[] )
+ deleteOutputOnInterrupt = False;
+ exitValue = 0;
+ i = j = 0; /* avoid bogus warning from egcs-1.1.X */
++ showProgress = False;
+
+ /*-- Set up signal handlers for mem access errors --*/
+ signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
+@@ -1880,6 +1936,7 @@ IntNative main ( IntNative argc, Char *argv[] )
+ case 'k': keepInputFiles = True; break;
+ case 's': smallMode = True; break;
+ case 'q': noisy = False; break;
++ case 'p': showProgress = True; break;
+ case '1': blockSize100k = 1; break;
+ case '2': blockSize100k = 2; break;
+ case '3': blockSize100k = 3; break;
+@@ -1916,6 +1973,7 @@ IntNative main ( IntNative argc, Char *argv[] )
+ if (ISFLAG("--keep")) keepInputFiles = True; else
+ if (ISFLAG("--small")) smallMode = True; else
+ if (ISFLAG("--quiet")) noisy = False; else
++ if (ISFLAG("--show-progress")) showProgress = True; else
+ if (ISFLAG("--version")) license(); else
+ if (ISFLAG("--license")) license(); else
+ if (ISFLAG("--exponential")) workFactor = 1; else
+diff --git a/bzip2-1.0.6/bzip2recover.c b/bzip2-1.0.6/bzip2recover.c
+index f9de049..db688c3 100644
+--- a/bzip2-1.0.6/bzip2recover.c
++++ b/bzip2-1.0.6/bzip2recover.c
+@@ -24,6 +24,8 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <fcntl.h>
++#include <unistd.h>
+
+
+ /* This program records bit locations in the file to be recovered.
+@@ -269,6 +271,19 @@ static Bool endsInBz2 ( Char* name )
+ name[n-1] == '2');
+ }
+
++/*---------------------------------------------*/
++/* Open an output file safely with O_EXCL and good permissions */
++FILE* fopen_output( Char* name, const char* mode )
++{
++ FILE *fp;
++ int fh;
++
++ fh = open(name, O_WRONLY|O_CREAT|O_EXCL, 0600);
++ if (fh == -1) return NULL;
++ fp = fdopen(fh, mode);
++ if (fp == NULL) close(fh);
++ return fp;
++}
+
+ /*---------------------------------------------------*/
+ /*--- ---*/
+@@ -306,6 +321,7 @@ Int32 main ( Int32 argc, Char** argv )
+ Int32 b, wrBlock, currBlock, rbCtr;
+ MaybeUInt64 bitsRead;
+
++
+ UInt32 buffHi, buffLo, blockCRC;
+ Char* p;
+
+@@ -486,7 +502,7 @@ Int32 main ( Int32 argc, Char** argv )
+ fprintf ( stderr, " writing block %d to `%s' ...\n",
+ wrBlock+1, outFileName );
+
+- outFile = fopen ( outFileName, "wb" );
++ outFile = fopen_output ( outFileName, "wb" );
+ if (outFile == NULL) {
+ fprintf ( stderr, "%s: can't write `%s'\n",
+ progName, outFileName );
+diff --git a/bzip2-1.0.6/bzlib.c b/bzip2-1.0.6/bzlib.c
+index bd358a7..6b84c93 100644
+--- a/bzip2-1.0.6/bzlib.c
++++ b/bzip2-1.0.6/bzlib.c
+@@ -1372,7 +1372,7 @@ const char * BZ_API(BZ2_bzlibVersion)(void)
+ #ifndef BZ_NO_STDIO
+ /*---------------------------------------------------*/
+
+-#if defined(_WIN32) || defined(OS2) || defined(MSDOS)
++#if defined(_WIN32) || defined(OS2) || defined(MSDOS) || defined(__CYGWIN__)
+ # include <fcntl.h>
+ # include <io.h>
+ # define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY)
+diff --git a/bzip2-1.0.6/bzlib.h b/bzip2-1.0.6/bzlib.h
+index 8277123..96fa84f 100644
+--- a/bzip2-1.0.6/bzlib.h
++++ b/bzip2-1.0.6/bzlib.h
+@@ -75,21 +75,39 @@ typedef
+ #include <stdio.h>
+ #endif
+
+-#ifdef _WIN32
++#if defined(_WIN32) && !defined(__CYGWIN__)
+ # include <windows.h>
+ # ifdef small
+ /* windows.h define small to char */
+ # undef small
+ # endif
+-# ifdef BZ_EXPORT
+-# define BZ_API(func) WINAPI func
+-# define BZ_EXTERN extern
++# ifndef __GNUC__
++ /* Use these rules only for non-gcc native win32 */
++# ifdef BZ_EXPORT
++# define BZ_API(func) WINAPI func
++# define BZ_EXTERN extern
++# else
++ /* import windows dll dynamically */
++# define BZ_API(func) (WINAPI * func)
++# define BZ_EXTERN
++# endif
+ # else
+- /* import windows dll dynamically */
+-# define BZ_API(func) (WINAPI * func)
+-# define BZ_EXTERN
++ /* For gcc on native win32, use import library trampoline */
++ /* functions on DLL import. This avoids requiring clients to */
++ /* use special compilation flags depending on whether eventual */
++ /* link will be against static libbz2 or against DLL, at the */
++ /* expense of a small loss of efficiency. */
++
++ /* Because libbz2 does not export any DATA items, GNU ld's */
++ /* "auto-import" is not a factor; the MinGW-built DLL can be */
++ /* used by other compilers, provided an import library suitable */
++ /* for that compiler is (manually) constructed using the .def */
++ /* file and the appropriate tool. */
++# define BZ_API(func) func
++# define BZ_EXTERN extern
+ # endif
+ #else
++ /* non-win32 platforms, and cygwin */
+ # define BZ_API(func) func
+ # define BZ_EXTERN extern
+ #endif
+diff --git a/bzip2-1.0.6/bzmore b/bzip2-1.0.6/bzmore
+index d314043..f423ed9 100644
+--- a/bzip2-1.0.6/bzmore
++++ b/bzip2-1.0.6/bzmore
+@@ -24,10 +24,10 @@ else
+ # 'stty min 1' resets eof to ^a on both SunOS and SysV!
+ cb='min 1 -icanon'; ncb='icanon eof ^d'
+ fi
+-if test $? -eq 0 -a -n "$oldtty"; then
+- trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15
++if test $? -eq 0 && test -n "$oldtty"; then
++ trap 'stty $oldtty 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM
+ else
+- trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15
++ trap 'stty $ncb echo 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM
+ fi
+
+ if test $# = 0; then
+@@ -46,7 +46,7 @@ else
+ ANS=`dd bs=1 count=1 2>/dev/null`
+ stty $ncb echo 2>/dev/null
+ echo " "
+- if test "$ANS" = 'e' -o "$ANS" = 'q'; then
++ if test "$ANS" = 'e' || test "$ANS" = 'q'; then
+ exit
+ fi
+ fi
diff --git bzip2-1.0.6/libbz2.def.in bzip2-1.0.6/libbz2.def.in
new file mode 100644
index 0000000..e233a73
--- /dev/null
+++ bzip2-1.0.6/libbz2.def.in
@@ -0,0 +1,27 @@
+LIBRARY %DLLNAME%-%DLLVER%
+DESCRIPTION "libbzip2: library for data compression"
+EXPORTS
+ BZ2_bzCompressInit
+ BZ2_bzCompress
+ BZ2_bzCompressEnd
+ BZ2_bzDecompressInit
+ BZ2_bzDecompress
+ BZ2_bzDecompressEnd
+ BZ2_bzReadOpen
+ BZ2_bzReadClose
+ BZ2_bzReadGetUnused
+ BZ2_bzRead
+ BZ2_bzWriteOpen
+ BZ2_bzWrite
+ BZ2_bzWriteClose
+ BZ2_bzWriteClose64
+ BZ2_bzBuffToBuffCompress
+ BZ2_bzBuffToBuffDecompress
+ BZ2_bzlibVersion
+ BZ2_bzopen
+ BZ2_bzdopen
+ BZ2_bzread
+ BZ2_bzwrite
+ BZ2_bzflush
+ BZ2_bzclose
+ BZ2_bzerror
diff --git bzip2-1.0.6/bzgrep bzip2-1.0.6/bzgrep
index 9a04b83..37de592 100644
--- bzip2-1.0.6/bzgrep
+++ bzip2-1.0.6/bzgrep
@@ -1,27 +1,75 @@
#!/bin/sh
-# Bzgrep wrapped for bzip2,
-# adapted from zgrep by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
-## zgrep notice:
-## zgrep -- a wrapper around a grep program that decompresses files as needed
-## Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
+# bzgrep -- a wrapper around a grep program that decompresses files as needed
+# Adapted from zgrep of the Debian gzip package by Anibal Monsalve Salazar.
+# Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca>
+
+# Copyright (C) 1998, 2001, 2002 Free Software Foundation
+# Copyright (C) 1993 Jean-loup Gailly
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
PATH="/usr/bin:$PATH"; export PATH
-prog=`echo $0 | sed 's|.*/||'`
+prog=`echo "$0" | sed 's|.*/||'`
case "$prog" in
*egrep) grep=${EGREP-egrep} ;;
*fgrep) grep=${FGREP-fgrep} ;;
*) grep=${GREP-grep} ;;
esac
+
pat=""
+after_dash_dash=""
+files_with_matches=0
+files_without_matches=0
+no_filename=0
+with_filename=0
+
while test $# -ne 0; do
- case "$1" in
- -e | -f) opt="$opt $1"; shift; pat="$1"
+ case "$after_dash_dash$1" in
+ --d* | --rec*) echo >&2 "$0: $1: option not supported"; exit 2;;
+ --files-with-*) files_with_matches=1;;
+ --files-witho*) files_without_matches=1;;
+ --no-f*) no_filename=1;;
+ --wi*) with_filename=1;;
+ --*) ;;
+ -*)
+ case "$1" in
+ -*[dr]*) echo >&2 "$0: $1: option not supported"; exit 2;;
+ esac
+ case "$1" in
+ -*H*) with_filename=1;;
+ esac
+ case "$1" in
+ -*h*) no_filename=1;;
+ esac
+ case "$1" in
+ -*L*) files_without_matches=1;;
+ esac
+ case "$1" in
+ -*l*) files_with_matches=1;;
+ esac;;
+ esac
+ case "$after_dash_dash$1" in
+ -[ef]) opt="$opt $1"; shift; pat="$1"
if test "$grep" = grep; then # grep is buggy with -e on SVR4
grep=egrep
fi;;
- -A | -B) opt="$opt $1 $2"; shift;;
+ -[ABCdm])opt="$opt $1 $2"; shift;;
+ --) opt="$opt $1"; after_dash_dash=1;;
-*) opt="$opt $1";;
*) if test -z "$pat"; then
pat="$1"
@@ -35,19 +83,9 @@ done
if test -z "$pat"; then
echo "grep through bzip2 files"
echo "usage: $prog [grep_options] pattern [files]"
- exit 1
+ exit 2
fi
-list=0
-silent=0
-op=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
-case "$op" in
- *l*) list=1
-esac
-case "$op" in
- *h*) silent=1
-esac
-
if test $# -eq 0; then
bzip2 -cdfq | $grep $opt "$pat"
exit $?
@@ -55,21 +93,40 @@ fi
res=0
for i do
- if test -f "$i"; then :; else if test -f "$i.bz2"; then i="$i.bz2"; fi; fi
- if test $list -eq 1; then
- bzip2 -cdfq "$i" | $grep $opt "$pat" 2>&1 > /dev/null && echo $i
- r=$?
- elif test $# -eq 1 -o $silent -eq 1; then
- bzip2 -cdfq "$i" | $grep $opt "$pat"
- r=$?
- else
- j=${i//\\/\\\\}
- j=${j//|/\\|}
- j=${j//&/\\&}
- j=`printf "%s" "$j" | tr '\n' ' '`
- bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
- r=$?
- fi
- test "$r" -ne 0 && res="$r"
+ bzip2 -cdfq -- "$i" |
+ if test $files_with_matches -eq 1; then
+ $grep $opt "$pat" > /dev/null && printf "%s\n" "$i"
+ elif test $files_without_matches -eq 1; then
+ $grep $opt "$pat" > /dev/null || printf "%s\n" "$i"
+ elif test $with_filename -eq 0 && { test $# -eq 1 || test $no_filename -eq 1; }; then
+ $grep $opt "$pat"
+ else
+ i=$(echo "$i" | sed -e 's/[\\|&]/\\&/g')
+ if test $with_filename -eq 1; then
+ sed_script="s|^[^:]*:|${i}:|"
+ else
+ sed_script="s|^|${i}:|"
+ fi
+ # Hack adapted from GPLed code at
+ # http://home.comcast.net/~j.p.h/cus-faq-2
+ # Has the same effect as the following two lines of bash:
+ #
+ # $grep $opt "$pat" | sed "$sed_script"
+ # exit ${PIPESTATUS[0]}
+ #
+ # Inside the `...`, fd4 goes to the pipe whose other end is read
+ # and passed to eval; fd1 is the normal standard output
+ # preserved the line before with exec 3>&1
+ exec 3>&1
+ eval `
+ exec 4>&1 >&3 3>&-
+ {
+ $grep $opt "$pat" 4>&-; echo "r=$?;" >&4
+ } | sed "$sed_script"
+ `
+ exit $r
+ fi
+ r=$?
+ test $res -lt $r && res=$r
done
exit $res
diff --git bzip2-1.0.6/bzip2.1 bzip2-1.0.6/bzip2.1
index ce3a78e..5302bd7 100644
--- bzip2-1.0.6/bzip2.1
+++ bzip2-1.0.6/bzip2.1
@@ -235,6 +235,10 @@ less), use \-s for everything. See MEMORY MANAGEMENT below.
Suppress non-essential warning messages. Messages pertaining to
I/O errors and other critical events will not be suppressed.
.TP
+.B \-p \-\-show\-progress
+Show percentage of input\-file done and while compressing show the percentage
+of the original file the new file is.
+.TP
.B \-v --verbose
Verbose mode -- show the compression ratio for each file processed.
Further \-v's increase the verbosity level, spewing out lots of
diff --git bzip2-1.0.6/bzip2.c bzip2-1.0.6/bzip2.c
index 6de9d1d..cdda5d2 100644
--- bzip2-1.0.6/bzip2.c
+++ bzip2-1.0.6/bzip2.c
@@ -53,6 +53,7 @@
#include <signal.h>
#include <math.h>
#include <errno.h>
+#include <time.h>
#include <ctype.h>
#include "bzlib.h"
@@ -128,7 +129,7 @@
#if BZ_LCCWIN32
# include <io.h>
# include <fcntl.h>
-# include <sys\stat.h>
+# include <sys/stat.h>
# define NORETURN /**/
# define PATH_SEP '\\'
@@ -209,6 +210,7 @@ Char *progName;
Char progNameReally[FILE_NAME_LEN];
FILE *outputHandleJustInCase;
Int32 workFactor;
+Char showProgress;
static void panic ( const Char* ) NORETURN;
static void ioError ( void ) NORETURN;
@@ -334,6 +336,12 @@ void compressStream ( FILE *stream, FILE *zStream )
UInt32 nbytes_in_lo32, nbytes_in_hi32;
UInt32 nbytes_out_lo32, nbytes_out_hi32;
Int32 bzerr, bzerr_dummy, ret;
+ double fileSize = 0; /* initialized to make the compiler stop crying */
+ /* double because big files might otherwhise give
+ * overflows. not long long since not all compilers
+ * support that one
+ */
+ time_t startTime, currentTime;
SET_BINARY_MODE(stream);
SET_BINARY_MODE(zStream);
@@ -341,12 +349,21 @@ void compressStream ( FILE *stream, FILE *zStream )
if (ferror(stream)) goto errhandler_io;
if (ferror(zStream)) goto errhandler_io;
+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
+ (void)fseek(stream, 0, SEEK_END);
+ fileSize = ftello(stream);
+ rewind(stream);
+ if (verbosity >= 1)
+ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
+ }
+
bzf = BZ2_bzWriteOpen ( &bzerr, zStream,
blockSize100k, verbosity, workFactor );
if (bzerr != BZ_OK) goto errhandler;
if (verbosity >= 2) fprintf ( stderr, "\n" );
+ time(&startTime);
while (True) {
if (myfeof(stream)) break;
@@ -355,6 +372,22 @@ void compressStream ( FILE *stream, FILE *zStream )
if (nIbuf > 0) BZ2_bzWrite ( &bzerr, bzf, (void*)ibuf, nIbuf );
if (bzerr != BZ_OK) goto errhandler;
+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
+ time(&currentTime);
+
+ if ((currentTime - startTime) > 1) { /* show progress every 2 seconds */
+ double curInPos = ftello(stream);
+ double curOutPos = ftello(zStream);
+
+ startTime = currentTime;
+
+ fprintf(stderr, "%.2f%% done", (curInPos * 100.0) / fileSize);
+ if (srcMode == SM_F2F)
+ fprintf(stderr, ", new size: %.2f%%", (curOutPos * 100.0) / curInPos);
+
+ fprintf(stderr, " \r");
+ }
+ }
}
BZ2_bzWriteClose64 ( &bzerr, bzf, 0,
@@ -439,6 +472,8 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
Int32 nUnused;
void* unusedTmpV;
UChar* unusedTmp;
+ double fileSize = 0; /* initialized to make the compiler stop crying */
+ time_t startTime, currentTime;
nUnused = 0;
streamNo = 0;
@@ -446,9 +481,19 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
SET_BINARY_MODE(stream);
SET_BINARY_MODE(zStream);
+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
+ off_t dummy = ftello(zStream);
+ (void)fseeko(zStream, 0, SEEK_END);
+ fileSize = ftello(zStream);
+ (void)fseeko(zStream, dummy, SEEK_SET);
+ if (verbosity >= 1)
+ fprintf(stderr, "Input-file size: %ld\n", (long)fileSize);
+ }
+
if (ferror(stream)) goto errhandler_io;
if (ferror(zStream)) goto errhandler_io;
+ time(&startTime);
while (True) {
bzf = BZ2_bzReadOpen (
@@ -464,6 +509,16 @@ Bool uncompressStream ( FILE *zStream, FILE *stream )
if ((bzerr == BZ_OK || bzerr == BZ_STREAM_END) && nread > 0)
fwrite ( obuf, sizeof(UChar), nread, stream );
if (ferror(stream)) goto errhandler_io;
+
+ if ((srcMode == SM_F2F || srcMode == SM_F2O) && showProgress == True) {
+ time(&currentTime);
+ if ((currentTime - startTime) >= 2) {
+ double curInPos = ftello(zStream);
+ startTime = currentTime;
+
+ fprintf(stderr, "%.2f%% done\r", (curInPos * 100.0) / fileSize);
+ }
+ }
}
if (bzerr != BZ_STREAM_END) goto errhandler;
@@ -1132,8 +1187,8 @@ Bool mapSuffix ( Char* name,
static
void compress ( Char *name )
{
- FILE *inStr;
- FILE *outStr;
+ FILE *inStr = NULL;
+ FILE *outStr = NULL;
Int32 n, i;
struct MY_STAT statBuf;
@@ -1313,8 +1368,8 @@ void compress ( Char *name )
static
void uncompress ( Char *name )
{
- FILE *inStr;
- FILE *outStr;
+ FILE *inStr = NULL;
+ FILE *outStr = NULL;
Int32 n, i;
Bool magicNumberOK;
Bool cantGuess;
@@ -1511,7 +1566,7 @@ void uncompress ( Char *name )
static
void testf ( Char *name )
{
- FILE *inStr;
+ FILE *inStr = NULL;
Bool allOK;
struct MY_STAT statBuf;
@@ -1803,6 +1858,7 @@ IntNative main ( IntNative argc, Char *argv[] )
deleteOutputOnInterrupt = False;
exitValue = 0;
i = j = 0; /* avoid bogus warning from egcs-1.1.X */
+ showProgress = False;
/*-- Set up signal handlers for mem access errors --*/
signal (SIGSEGV, mySIGSEGVorSIGBUScatcher);
@@ -1880,6 +1936,7 @@ IntNative main ( IntNative argc, Char *argv[] )
case 'k': keepInputFiles = True; break;
case 's': smallMode = True; break;
case 'q': noisy = False; break;
+ case 'p': showProgress = True; break;
case '1': blockSize100k = 1; break;
case '2': blockSize100k = 2; break;
case '3': blockSize100k = 3; break;
@@ -1916,6 +1973,7 @@ IntNative main ( IntNative argc, Char *argv[] )
if (ISFLAG("--keep")) keepInputFiles = True; else
if (ISFLAG("--small")) smallMode = True; else
if (ISFLAG("--quiet")) noisy = False; else
+ if (ISFLAG("--show-progress")) showProgress = True; else
if (ISFLAG("--version")) license(); else
if (ISFLAG("--license")) license(); else
if (ISFLAG("--exponential")) workFactor = 1; else
diff --git bzip2-1.0.6/bzip2recover.c bzip2-1.0.6/bzip2recover.c
index f9de049..db688c3 100644
--- bzip2-1.0.6/bzip2recover.c
+++ bzip2-1.0.6/bzip2recover.c
@@ -24,6 +24,8 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
/* This program records bit locations in the file to be recovered.
@@ -269,6 +271,19 @@ static Bool endsInBz2 ( Char* name )
name[n-1] == '2');
}
+/*---------------------------------------------*/
+/* Open an output file safely with O_EXCL and good permissions */
+FILE* fopen_output( Char* name, const char* mode )
+{
+ FILE *fp;
+ int fh;
+
+ fh = open(name, O_WRONLY|O_CREAT|O_EXCL, 0600);
+ if (fh == -1) return NULL;
+ fp = fdopen(fh, mode);
+ if (fp == NULL) close(fh);
+ return fp;
+}
/*---------------------------------------------------*/
/*--- ---*/
@@ -306,6 +321,7 @@ Int32 main ( Int32 argc, Char** argv )
Int32 b, wrBlock, currBlock, rbCtr;
MaybeUInt64 bitsRead;
+
UInt32 buffHi, buffLo, blockCRC;
Char* p;
@@ -486,7 +502,7 @@ Int32 main ( Int32 argc, Char** argv )
fprintf ( stderr, " writing block %d to `%s' ...\n",
wrBlock+1, outFileName );
- outFile = fopen ( outFileName, "wb" );
+ outFile = fopen_output ( outFileName, "wb" );
if (outFile == NULL) {
fprintf ( stderr, "%s: can't write `%s'\n",
progName, outFileName );
diff --git bzip2-1.0.6/bzlib.c bzip2-1.0.6/bzlib.c
index bd358a7..6b84c93 100644
--- bzip2-1.0.6/bzlib.c
+++ bzip2-1.0.6/bzlib.c
@@ -1372,7 +1372,7 @@ const char * BZ_API(BZ2_bzlibVersion)(void)
#ifndef BZ_NO_STDIO
/*---------------------------------------------------*/
-#if defined(_WIN32) || defined(OS2) || defined(MSDOS)
+#if defined(_WIN32) || defined(OS2) || defined(MSDOS) || defined(__CYGWIN__)
# include <fcntl.h>
# include <io.h>
# define SET_BINARY_MODE(file) setmode(fileno(file),O_BINARY)
diff --git bzip2-1.0.6/bzlib.h bzip2-1.0.6/bzlib.h
index 8277123..96fa84f 100644
--- bzip2-1.0.6/bzlib.h
+++ bzip2-1.0.6/bzlib.h
@@ -75,21 +75,39 @@ typedef
#include <stdio.h>
#endif
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
# include <windows.h>
# ifdef small
/* windows.h define small to char */
# undef small
# endif
-# ifdef BZ_EXPORT
-# define BZ_API(func) WINAPI func
-# define BZ_EXTERN extern
+# ifndef __GNUC__
+ /* Use these rules only for non-gcc native win32 */
+# ifdef BZ_EXPORT
+# define BZ_API(func) WINAPI func
+# define BZ_EXTERN extern
+# else
+ /* import windows dll dynamically */
+# define BZ_API(func) (WINAPI * func)
+# define BZ_EXTERN
+# endif
# else
- /* import windows dll dynamically */
-# define BZ_API(func) (WINAPI * func)
-# define BZ_EXTERN
+ /* For gcc on native win32, use import library trampoline */
+ /* functions on DLL import. This avoids requiring clients to */
+ /* use special compilation flags depending on whether eventual */
+ /* link will be against static libbz2 or against DLL, at the */
+ /* expense of a small loss of efficiency. */
+
+ /* Because libbz2 does not export any DATA items, GNU ld's */
+ /* "auto-import" is not a factor; the MinGW-built DLL can be */
+ /* used by other compilers, provided an import library suitable */
+ /* for that compiler is (manually) constructed using the .def */
+ /* file and the appropriate tool. */
+# define BZ_API(func) func
+# define BZ_EXTERN extern
# endif
#else
+ /* non-win32 platforms, and cygwin */
# define BZ_API(func) func
# define BZ_EXTERN extern
#endif
diff --git bzip2-1.0.6/bzmore bzip2-1.0.6/bzmore
index d314043..f423ed9 100644
--- bzip2-1.0.6/bzmore
+++ bzip2-1.0.6/bzmore
@@ -24,10 +24,10 @@ else
# 'stty min 1' resets eof to ^a on both SunOS and SysV!
cb='min 1 -icanon'; ncb='icanon eof ^d'
fi
-if test $? -eq 0 -a -n "$oldtty"; then
- trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15
+if test $? -eq 0 && test -n "$oldtty"; then
+ trap 'stty $oldtty 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM
else
- trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15
+ trap 'stty $ncb echo 2>/dev/null; exit' 0 INT QUIT TRAP USR1 PIPE TERM
fi
if test $# = 0; then
@@ -46,7 +46,7 @@ else
ANS=`dd bs=1 count=1 2>/dev/null`
stty $ncb echo 2>/dev/null
echo " "
- if test "$ANS" = 'e' -o "$ANS" = 'q'; then
+ if test "$ANS" = 'e' || test "$ANS" = 'q'; then
exit
fi
fi
# CA certificates
[buildout]
extends =
../patch/buildout.cfg
parts =
ca-certificates
[ca-certificates-sbin-dir.patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = 0b4e7d82ce768823c01954ee41ef177b
filename = ${:_buildout_section_name_}
download-only = true
[ca-certificates]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
version = 20120623
url = ftp://ftp.free.fr/mirrors/ftp.debian.org/pool/main/c/ca-certificates/ca-certificates_${:version}.tar.gz
patch-binary = ${patch:location}/bin/patch
md5sum = 5105d4cc086f0d4ecf7bf2e4c4667289
patches =
${ca-certificates-sbin-dir.patch:location}/${ca-certificates-sbin-dir.patch:filename}
patch-options = -p0
configure-command = true
make-targets = install DESTDIR=${buildout:parts-directory}/${:_buildout_section_name_} CERTSDIR=certs SBINDIR=sbin
make-targets = install DESTDIR=%(prefix)s CERTSDIR=certs SBINDIR=sbin
patches =
${:_profile_base_location_}/ca-certificates-sbin-dir.patch#0b4e7d82ce768823c01954ee41ef177b
......@@ -6,34 +6,38 @@ extends =
../openssl/buildout.cfg
parts =
cclient-patch
cclient
[cclient-patch]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/imap-2007f.patch
md5sum = 42c77fdd5d7a976fc302b93aadb3da98
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = imap-2007f.patch
[cclient]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies = openssl
url = ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
md5sum = 2126fd125ea26b73b20f01fcd5940369
configure-command = true
# cclient does not support parallel compilation
patch-options = -p1
patches =
${:_profile_base_location_}/imap-2007f.patch#42c77fdd5d7a976fc302b93aadb3da98
make-options =
slx
SSLTYPE=unix
SSLDIR=${openssl:location}
SSLCRYPTO=-lcrypto
IP=6
SSLLIB=${openssl:location}/lib
EXTRACFLAGS=-fPIC
CCLIENT=${buildout:parts-directory}
CCLIENT=%(prefix)s
-j1
patches =
${cclient-patch:location}/${cclient-patch:filename}
patch-options = -p1
[x86-cygwin-cclient]
# cclient does not support parallel compilation
make-options =
cyg
SSLTYPE=none
${cclient:make-options}
[x86-linux-cclient]
# cclient does not support parallel compilation
make-options =
slx
SSLTYPE=unix
SSLDIR=${openssl:prefix}
SSLLIB=${openssl:prefix}/lib
${cclient:make-options}
\ No newline at end of file
......@@ -10,7 +10,8 @@ parts =
curl
[curl]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies = zlib openssl pkgconfig
url = http://curl.haxx.se/download/curl-7.24.0.tar.bz2
#md5sum = 5f6d50c4d4ee38c57fe37e3cff75adbd
configure-options =
......@@ -27,12 +28,15 @@ configure-options =
--disable-gopher
--enable-ipv6
--disable-sspi
--with-ssl=${openssl:location}
--with-zlib=${zlib:location}
--without-nss
--without-libssh2
--without-libidn
[x86-linux-curl]
configure-options =
--with-ssl=${openssl:location}
--with-zlib=${zlib:location}
environment =
PATH=${pkgconfig:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig
......
diff --git a/slapos/grid/slapgrid.py b/slapos/grid/slapgrid.py
index a459639..a5a31f6 100644
--- a/slapos/grid/slapgrid.py
+++ b/slapos/grid/slapgrid.py
@@ -659,7 +659,7 @@ class Slapgrid(object):
process_handler = subprocess.Popen(command,
preexec_fn=lambda: dropPrivileges(uid, gid),
cwd=cwd,
- env={}, **kw)
+ env=None, **kw)
process_handler.stdin.flush()
process_handler.stdin.close()
process_handler.stdin = None
diff --git a/slapos/grid/utils.py b/slapos/grid/utils.py
index c27603e..de10406 100644
--- a/slapos/grid/utils.py
+++ b/slapos/grid/utils.py
@@ -97,6 +97,8 @@ class SlapPopen(subprocess.Popen):
"""
def __init__(self, *args, **kwargs):
kwargs.update(stdin=subprocess.PIPE)
+ if sys.platform == 'cygwin' and kwargs.get('env') == {}:
+ kwargs['env'] = None
subprocess.Popen.__init__(self, *args, **kwargs)
self.stdin.flush()
self.stdin.close()
--- slapos.core-0.33-py2.6.egg/slapos/format.py 2012-11-08 09:45:24.718750000 +0800
+++ slapos.core-0.33-py2.7.egg/slapos/format.py 2012-11-21 19:20:09.593750000 +0800
--- a/slapos/format.py 2012-11-08 09:45:24.718750000 +0800
+++ b/slapos/format.py 2012-11-21 19:20:09.593750000 +0800
@@ -460,9 +460,9 @@
# This method shall check if all is correctly done
# This method shall not reset groups, just add them
......
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Using SlapOS in the Windows</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" title="Using SlapOS in the Windows"><div class="titlepage"><div><div><h1 class="title"><a name="id9225933"></a>Using SlapOS in the Windows</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Jondy</span> <span class="surname">Zhao</span></h3></div></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision 0.1</td><td align="left">2013-01-06</td><td align="left">Jondy Zhao - jondy.zhao@gmail.com</td></tr><tr><td align="left" colspan="3">Create the document.</td></tr></table></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#ch_introduction">1. Introduction</a></span></dt><dt><span class="chapter"><a href="#ch_register_slapos_org">2. Registering in the slapos.org</a></span></dt><dt><span class="chapter"><a href="#ch_install_slapos">3. Installing SlapOS slave node</a></span></dt><dd><dl><dt><span class="section"><a href="#id9211182">3.1. Installing by MSI Package</a></span></dt><dt><span class="section"><a href="#id9213740">3.2. Installing by sources</a></span></dt><dd><dl><dt><span class="section"><a href="#id9213749">3.2.1. Install Cygwin</a></span></dt><dt><span class="section"><a href="#id9213848">3.2.2. Buildout SlapOS</a></span></dt><dt><span class="section"><a href="#id9213913">3.2.3. IPv6 Support</a></span></dt><dt><span class="section"><a href="#id9213973">3.2.4. Run slapformat</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#ch_create_instance_wordpress">4. Creating an instancee of Wordpress in the SlapOS</a></span></dt><dt><span class="appendix"><a href="#appendix_cygwin_packages">A. Cygwin Required Packages List</a></span></dt></dl></div><div class="chapter" title="Chapter1.Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="ch_introduction"></a>Chapter1.Introduction</h2></div></div></div><p>SlapOS can be described as a cloud operating system in which "everything is a process" unlike Unix in which "everything is a file". If one has to manage thousands of servers with thousands of processes, hundred different applications in multiple different releases or versions, SlapOS can help you a lot by making the whole management process well specified, automated and under control.</p><p>The goal of this tutorial is to teach how to use SlapOS in the windows.
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>First you need register an account in the slapos.org (refer to <a class="xref" href="#ch_register_slapos_org" title="Chapter2.Registering in the slapos.org">Chapter2, <i>Registering in the slapos.org</i></a>)</p></li><li class="listitem"><p>Then install SlapOS slave node in the windows (refer to <a class="xref" href="#ch_install_slapos" title="Chapter3.Installing SlapOS slave node">Chapter3, <i>Installing SlapOS slave node</i></a>)</p></li><li class="listitem"><p>Finally release software and create instanace of software in the SlapOS node (refer to <a class="xref" href="#ch_create_instance_wordpress" title="Chapter4.Creating an instancee of Wordpress in the SlapOS">Chapter4, <i>Creating an instancee of Wordpress in the SlapOS</i></a>)</p></li></ul></div><p>
</p></div><div class="chapter" title="Chapter2.Registering in the slapos.org"><div class="titlepage"><div><div><h2 class="title"><a name="ch_register_slapos_org"></a>Chapter2.Registering in the slapos.org</h2></div></div></div><p>Before we start, we need to register in VIFIB community Cloud. By doing so, we will obtain X509 certificate and key, make sure you store both of them to your local files. Take also note of the computer id, for example "COMP-161", store it somewhere. All of these are later needed for the installing process.</p><p>Refer to <a class="ulink" href="http://www.slapos.org/wiki/slapos-Wiki.Home/osoe-Lecture.SlapOS.Extended/developer-Installing.SlapOS.Slave.Node.Source" target="_top">http://www.slapos.org/wiki/slapos-Wiki.Home/osoe-Lecture.SlapOS.Extended/developer-Installing.SlapOS.Slave.Node.Source</a> in the section VIFIB Registration.</p></div><div class="chapter" title="Chapter3.Installing SlapOS slave node"><div class="titlepage"><div><div><h2 class="title"><a name="ch_install_slapos"></a>Chapter3.Installing SlapOS slave node</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id9211182">3.1. Installing by MSI Package</a></span></dt><dt><span class="section"><a href="#id9213740">3.2. Installing by sources</a></span></dt><dd><dl><dt><span class="section"><a href="#id9213749">3.2.1. Install Cygwin</a></span></dt><dt><span class="section"><a href="#id9213848">3.2.2. Buildout SlapOS</a></span></dt><dt><span class="section"><a href="#id9213913">3.2.3. IPv6 Support</a></span></dt><dt><span class="section"><a href="#id9213973">3.2.4. Run slapformat</a></span></dt></dl></dd></dl></div><p>There are 2 ways to install SlapOS slave node in the winodws. One is by MSI package, the other is by sources.</p><div class="section" title="3.1.Installing by MSI Package"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id9211182"></a>3.1.Installing by MSI Package</h2></div></div></div><p>Download slapos windows installer: <a class="ulink" href="http://www.slapos.org/slapos-0.135-cygwin.exe" target="_top">http://www.slapos.org/slapos-0.135-cygwin.exe</a></p><p>Run this MSI installer, click Next and type the information: the destination path, startup menu name, etc.</p><p>In the SlapOS Node Information wizard page, type the information got at above chapter.
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Computer ID</p></li><li class="listitem"><p>Key</p></li><li class="listitem"><p>Certificate</p></li></ul></div><p>
At the final wizard page, click Install.
</p><p>Waiting for everything done.</p></div><div class="section" title="3.2.Installing by sources"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id9213740"></a>3.2.Installing by sources</h2></div></div></div><p>We need Cygwin environment in order to install SlapOS slave node from sources in the Windows. </p><div class="section" title="3.2.1.Install Cygwin"><div class="titlepage"><div><div><h3 class="title"><a name="id9213749"></a>3.2.1.Install Cygwin</h3></div></div></div><p>Go to <a class="ulink" href="http://cygwin.com/" target="_top">"http://cygwin.com/"</a> and click on <a class="ulink" href="http://cygwin.com/setup.exe" target="_top">"Install Cygwin Now!"</a>. This will download a GUI installer called setup.exe which can be run to download a complete cygwin installation via the internet. Follow the instructions on each screen to install Cygwin. </p><p>The Root Directory for Cygwin (default C:\cygwin) will become / within your Cygwin installation. You must have write access to the parent directory, and any ACLs on the parent directory will determine access to installed files.</p><p>By default, setup.exe will install only the packages in the Base category and their dependencies, resulting in a minimal Cygwin installation. We need choose the packages required by SlapOS, see <a class="xref" href="#appendix_cygwin_packages" title="AppendixA.Cygwin Required Packages List">AppendixA, <i>Cygwin Required Packages List</i></a>. Since setup.exe automatically selects dependencies, be careful not to unselect any required packages.</p><p>You can install cygwin in the command console either:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Click startup menu</p></li><li class="listitem"><p>Click Run, type command: 'cmd', click OK to enter windows console</p></li><li class="listitem"><p>Type the following commands:</p><pre class="programlisting">
C:\Documents and Settings\Administrator&gt;D:
D:\&gt;MD slapos
D:\&gt;cd slapos
</pre></li><li class="listitem"><p>Download setup.exe to D:\slapos from cygwin.com</p></li><li class="listitem"><p>In the windows console, run:</p><pre class="programlisting">
D:\slapos&gt;setup.exe -X -n --site http://mirrors.163.com/cygwin --root D:/slapos/cygwin --quite-mode -P cygrunsrv -P binutils -P gcc4 -P libtool -P make -P autobuild -P autoconf -P automake -P libiconv -P zlib-devel -P patch -P python -P wget -P vim
</pre><p>
</p></li></ul></div><p>
</p></div><div class="section" title="3.2.2.Buildout SlapOS"><div class="titlepage"><div><div><h3 class="title"><a name="id9213848"></a>3.2.2.Buildout SlapOS</h3></div></div></div><p>Double click the desktop icon "Cygwin" or C:\cygwin\Cygwin.bat (Assume the cygwin root directory is C:\cygwin). A cygwin box will open, the following commands are typed in this box.
</p><pre class="programlisting">
$ echo "export CYGWIN=server" &gt;&gt; ~/.bash_profile
$ cygrunsrv --install cygslapos --path /usr/sbin/cygserver
$ sed -i -e "s/4\.3\.4/4.5.3/g" /usr/bin/libtool
$ mkdir -p /opt/slapos
$ mkdir -p /opt/download-cache
$ cd /opt/slapos
$ echo "[buildout]
extends = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/cygwin:/component/slapos/buildout.cfg
download-cache = /opt/download-cache
prefix = ${buildout:directory}
" &gt; buildout.cfg
$ python -S -c 'import urllib2;print urllib2.urlopen("http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/bootstrap.py").read()' &gt; bootstrap.py
$ python -S bootstrap.py
$ bin/buildout
</pre><p>
Now we need patch slapos.core for supporting cygwin, after these code are merged, it don't need.
</p><pre class="programlisting">
$ wget http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/cygwin:/component/cygwin/cygwin-slapos-core-format.patch
$ wget http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/cygwin:/component/cygwin/cygwin-slapos-core-env-none.patch
$ cd eggs/slapos.core-0.33.1-py2.7.egg/slapos
$ patch -p1 &lt; /opt/slapos/cygwin-slapos-core-format.patch
$ patch -p1 &lt; /opt/slapos/cygwin-slapos-env-none.patch
</pre><p>
</p></div><div class="section" title="3.2.3.IPv6 Support"><div class="titlepage"><div><div><h3 class="title"><a name="id9213913"></a>3.2.3.IPv6 Support</h3></div></div></div><p>If native IPv6 is available, skip this section. Otherwise be sure you have installed IPv6 by the command:
</p><pre class="programlisting">$ netsh interface ipv6 install</pre><p>
</p><p>Download openvpn windows installer, for example, openvpn-2.2.1-install.exe, then install openvpn. By default, it installed at <code class="filename">C:\Program Files\OpenVPN</code></p><p>Copy required files of openvpn to /opt/openvpn and edit client.ovpn
</p><pre class="programlisting">
$ mkdir -p /opt/openvpn
$ cd /opt/openvpn
$ cp "C:/Program Files/OpenVPN/bin/*" /opt/openvpn
$ cp -a "C:/Program Files/OpenVPN/config" /opt/openvpn
$ chmod 755 *.exe
$ cd config
$ wget http://www.slapos.org/vifib-ca.crt/getData -O ca.crt
$ http://www.slapos.org/vifib-client.crt/getData -O client-vifib.crt
$ wget http://www.slapos.org/vifib-client.key/getData -O client-vifib.key
$ mv client.ovpn vifib.ovpn
$ vi vifib.ovpn
# Edit the following options
dev tap
proto tcp
remote 176.31.103.87 443
ca ca.crt
cert client-vifib.crt
key client-vifib.key
</pre><p>
</p></div><div class="section" title="3.2.4.Run slapformat"><div class="titlepage"><div><div><h3 class="title"><a name="id9213973"></a>3.2.4.Run slapformat</h3></div></div></div><p>Assume we have registered a server which id is 'COMP-161', and saved its key and certificate files in the home directory. So we can use script 'configure.sh' to do all the configuration.
</p><pre class="programlisting">
$ mkdir -p /etc/slapos/ssl
$ mkdir -p /etc/slapos/ssl/partition_pki
$ cd /
$ wget http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/cygwin:/component/cygwin/configure.sh
$ /configure.sh COMP-161 ~/computer.key ~/computer.crt
</pre><p>
</p><p>Finally, run slapformat
</p><pre class="programlisting">
$ cd /opt/slapos
$ bin/slapformat -c --now /etc/slapos/slapos.cfg
</pre><p>
</p></div></div></div><div class="chapter" title="Chapter4.Creating an instancee of Wordpress in the SlapOS"><div class="titlepage"><div><div><h2 class="title"><a name="ch_create_instance_wordpress"></a>Chapter4.Creating an instancee of Wordpress in the SlapOS</h2></div></div></div><p>The common way to release a software is to login vifib website. But we haven't integrated this software.cfg into vifib, so we verify it in the local machine. It need a patch:
</p><pre class="programlisting">
$ cd /opt/slapos
$ wget http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/cygwin:/component/slapos/slapgrid-test-local-software.patch
$ cd /opt/slapos/eggs/slapos.core-0.33.1-py2.7.egg
$ patch -p1 &lt; /opt/slapos/slapgrid-test-local-software.patch
</pre><p>
Release Wordpress:
</p><pre class="programlisting">
$ mkdir -p /var/slapgrid/instance
$ mkdir -p /var/slapgrid/software
$ bin/slapgrid --only_sr http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/cygwin:/software/wordpress/software.cfg /etc/slapos/slapos.cfg
</pre><p>
</p><p>Some dlls need to rebase in order to avoid fork issue in the Cygwin. Refer to <a class="ulink" href="http://cygwin.com/faq.html" target="_top">http://cygwin.com/faq.html</a> question 4.44 or search "rebase" in this page. First, exit all Cygwin processes and stop all Cygwin services.
</p><pre class="programlisting">
$ net stop cfgslapos
$ ps -ef | grep python2.7
# kill all these process which start by supervisord
$ exit
</pre><p>
If you install SlapOS node by MSI package, Click Start menu, select SlapOS program group, click Run rebaseall. Otherwise, download rebase-software.bat and save it in the cygwin root path.
</p><pre class="programlisting">
$ cd /
$ wget http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/cygwin:/component/cygwin/rebase-software.bat
$ exit
</pre><p>
Double click rebase-software.bat in the windows explorer. The file should be in the directory "C:/cygwin"
</p><p>Create an instance:
</p><pre class="programlisting">
$ net start cygslapos
$ bin/slapgrid --only_sr http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/cygwin:/software/wordpress/software.cfg /etc/slapos/slapos.cfg
</pre><p>
Now wordpress should work. Type "http://localhost:8080/index.php" in your browser to check it.</p></div><div class="appendix" title="AppendixA.Cygwin Required Packages List"><div class="titlepage"><div><div><h2 class="title"><a name="appendix_cygwin_packages"></a>AppendixA.Cygwin Required Packages List</h2></div></div></div><p>The following packages are required when building SlapOS Node
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Admin/cygrunsrv</p></li><li class="listitem"><p>Devel/autobuild</p></li><li class="listitem"><p>Devel/autoconf</p></li><li class="listitem"><p>Devel/automake</p></li><li class="listitem"><p>Devel/binutils</p></li><li class="listitem"><p>Devel/gcc<sup>4.5.4</sup></p></li><li class="listitem"><p>Devel/libtool</p></li><li class="listitem"><p>Devel/make</p></li><li class="listitem"><p>Devel/libiconv<sup>?</sup></p></li><li class="listitem"><p>Devel/zlib-devel<sup>?</sup></p></li><li class="listitem"><p>Utils/patch<sup>*</sup></p></li><li class="listitem"><p>Python/python<sup>2.6*</sup></p></li><li class="listitem"><p>Web/wget<sup>*</sup></p></li><li class="listitem"><p>Web/git<sup>*</sup></p></li><li class="listitem"><p>Editor/vim<sup>*</sup></p></li></ul></div><p>
</p></div></div></body></html>
......@@ -7,11 +7,14 @@ extends =
../zlib/buildout.cfg
[file]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies = zlib
url = ftp://ftp.astron.com/pub/file/file-5.11.tar.gz
md5sum = 16a407bd66d6c7a832f3a5c0d609c27b
configure-options =
--disable-static
[x86-linux-file]
environment =
CPPFLAGS=-I${zlib:location}/include
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
......@@ -10,11 +10,14 @@ parts =
freetype
[freetype]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies = zlib bzip2
url = http://download.savannah.gnu.org/releases/freetype/freetype-2.4.9.tar.bz2
md5sum = 77a893dae81fd5b896632715ca041179
configure-options =
--disable-static
[x86-linux-freetype]
environment =
CPPFLAGS=-I${bzip2:location}/include -I${zlib:location}/include
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
......@@ -3,19 +3,22 @@ parts =
gdbm
[gdbm]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
version = 1.10
url = ftp://ftp.gnu.org/gnu/gdbm/gdbm-${:version}.tar.gz
md5sum = 88770493c2559dc80b561293e39d3570
configure-options =
--disable-static
[x86-linux-gdbm]
# install as parts/gdbm/include/gdbm/*.h etc. because some softwares
# (eg. python's dbmmodule.c extension) assume the location like this.
includedir = ${buildout:parts-directory}/${:_buildout_section_name_}/include
make-targets =
install includedir=${:includedir}/gdbm && rm -f ${:includedir}/*.h && ln -sf gdbm/gdbm.h ${:includedir}/gdbm.h
install includedir=%(preifx)s/gdbm
post-install = rm -f %(preifx)s/*.h && ln -sf gdbm/gdbm.h %(preifx)s/gdbm.h
# it seems that parallel build sometimes fails for gdbm.
make-options =
-j1
patches = /opt/patch/gdbm-1.10-cygwin.patch
[x86-cygwin-gdbm]
patches = ${:_profile_base_location_}/cygwin-gdbm-1.10-src.patch
--- src/Makefile.am.org 2012-11-07 20:42:53.281250000 +0800
+++ src/Makefile.am 2012-11-07 20:43:12.421875000 +0800
@@ -60,7 +60,7 @@
update.c\
version.c
-libgdbm_la_LDFLAGS = -version-info $(VI_CURRENT):$(VI_REVISION):$(VI_AGE)
+libgdbm_la_LDFLAGS = -version-info $(VI_CURRENT):$(VI_REVISION):$(VI_AGE) -no-undefined
# Programs
bin_PROGRAMS = testgdbm
--- configure.ac.org 2012-11-07 21:03:20.359375000 +0800
+++ configure.ac 2012-11-07 21:03:45.640625000 +0800
@@ -87,6 +87,8 @@
dnl AC_C_BIGENDIAN([])
AC_C_CONST
+AC_LIBTOOL_WIN32_DLL
+
dnl Internationalization macros.
AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION(0.18)
[buildout]
parts =
gettext
extends =
../ncurses/buildout.cfg
../libiconv/buildout.cfg
../libxml2/buildout.cfg
../zlib/buildout.cfg
[gettext-drop.gets.patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = 1a17a2e6c1539927304379dfa0f149c5
download-only = true
filename = drop.gets.patch
parts = gettext
[gettext]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies = libiconv zlib ncurses libxml2
url = http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.1.1.tar.gz
md5sum = 3dd55b952826d2b32f51308f2f91aa89
patches = /opt/patch/gettext-0.18.1.1-cygwin.patch
configure-options =
--disable-static
--disable-java
--disable-csharp
--with-libncurses-prefix=${ncurses:location}
--with-libxml2-prefix=${libxml2:location}
--with-included-gettext
--without-emacs
--disable-acl
--disable-openmp
--without-git
patches = ${:_profile_base_location_}/drop.gets.patch
[x86-cygwin-gettext]
# Refer to http://savannah.gnu.org/bugs/?36443 for CFLAGS/CXXFLAGS -O2
configure-options =
${gettext:configure-options}
CFLAGS="$CFLAGS -O2"
CXXFLAGS="$CXXFLAGS -O2"
patches =
${:_profile_base_location_}/cygwin-gettext-0.18.1.1-src.patch
environment =
CPPFLAGS=-I${libxml2:location}/include -I${zlib:location}/include -I${ncurses:location}/include
LDFLAGS=-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib
......@@ -4,7 +4,10 @@ extends =
../zlib/buildout.cfg
[glib]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies =
zlib
gettext
url = http://ftp.gnome.org/pub/gnome/sources/glib/2.28/glib-2.28.8.tar.bz2
md5sum = 789e7520f71c6a4bf08bc683ec764d24
configure-options =
......@@ -13,9 +16,6 @@ configure-options =
--disable-fam
--disable-xattr
patches = /opt/patch/glib-2.28.8-cygwin.patch
environment =
CPPFLAGS=-I${zlib:location}/include -I${gettext:location}/include
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib
PATH=${gettext:location}/bin:${ncurses:location}/bin:%(PATH)s
[x86-cygwin-glib]
patches =
${:_profile_base_location_}/cygwin-glib-2.28.8-src.patch
--- glib/gstrfuncs.c~ 2012-12-30 14:51:30.000000000 +0800
+++ glib/gstrfuncs.c 2012-12-30 14:51:50.203125000 +0800
@@ -1423,7 +1423,7 @@
#ifdef HAVE_STRSIGNAL
const char *msg_locale;
-#if defined(G_OS_BEOS) || defined(G_WITH_CYGWIN)
+#if defined(G_OS_BEOS)
extern const char *strsignal(int);
#else
/* this is declared differently (const) in string.h on BeOS */
......@@ -9,4 +9,5 @@ url = http://ftp.free.fr/mirrors/ftp.debian.org/pool/main/liba/libaio/libaio_0.3
md5sum = 435a5b16ca6198eaf01155263d855756
location = ${buildout:parts-directory}/${:_buildout_section_name_}
configure-command = echo
make-options = prefix=${:location}
# make-options = prefix=${:location}
make-binary = true
......@@ -2,7 +2,7 @@
parts = libevent
[libevent]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz
md5sum = 0b3ea18c634072d12b3c1ee734263664
configure-options =
......
......@@ -3,7 +3,7 @@ parts =
libexpat
[libexpat]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download
md5sum = dd7dab7a5fea97d2a6a43f511449b7cd
configure-options =
......
......@@ -3,6 +3,6 @@ parts =
libiconv
[libiconv]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
md5sum = e34509b1623cec449dfeb73d7ce9c6c6
......@@ -3,7 +3,7 @@ parts =
libjpeg
[libjpeg]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://www.ijg.org/files/jpegsrc.v8d.tar.gz
md5sum = 52654eb3b2e60c35731ea8fc87f1bd29
configure-options =
......
......@@ -3,23 +3,18 @@ extends =
../zlib/buildout.cfg
parts =
libpng12
libpng
[libpng-common]
recipe = hexagonit.recipe.cmmi
[libpng]
recipe = slapos.recipe.cmmi
dependencies = zlib
url = http://download.sourceforge.net/libpng/libpng-1.5.12.tar.bz2
md5sum = d87f9c34ccab8242c00e41925839f6c9
configure-options =
--disable-static
[x86-linux-libpng]
environment =
CPPFLAGS =-I${zlib:location}/include
LDFLAGS =-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
[libpng12]
<= libpng-common
url = http://download.sourceforge.net/libpng/libpng-1.2.50.tar.bz2
md5sum = 717caa58e9c71a80820eb38c4f4d6ec3
[libpng]
<= libpng-common
url = http://download.sourceforge.net/libpng/libpng-1.5.12.tar.bz2
md5sum = d87f9c34ccab8242c00e41925839f6c9
......@@ -2,7 +2,7 @@
parts = libtool
[libtool]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
md5sum = d2f3b7d4627e69e13514a40e72a24d50
url = http://ftp.gnu.org/gnu/libtool/libtool-2.4.2.tar.gz
configure-options =
......
......@@ -3,7 +3,7 @@ parts =
libuuid
[libuuid]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://www.kernel.org/pub/linux/utils/util-linux/v2.18/util-linux-ng-2.18.tar.bz2
md5sum = 2f5f71e6af969d041d73ab778c141a77
configure-options =
......@@ -38,3 +38,7 @@ configure-options =
make-options =
-C shlibs/uuid
[cygwin-libuuid]
environment =
LDFLAGS =-no-undefined
\ No newline at end of file
......@@ -7,13 +7,11 @@ parts =
libxml2
[libxml2]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies = zlib
url = ftp://ftp.xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz
md5sum = c62106f02ee00b6437f0fb9d370c1093
configure-options =
--disable-static
--without-python
--without-lzma
--with-zlib=${zlib:location}
environment =
LDFLAGS = -Wl,-rpath=${zlib:location}/lib
......@@ -8,16 +8,21 @@ parts =
libxslt
[libxslt]
recipe = slapos.recipe.cmmi
dependencies = zlib libxml2 pkgconfig
url = ftp://xmlsoft.org/libxslt/libxslt-1.1.26.tar.gz
md5sum = e61d0364a30146aaa3001296f853b2b9
recipe = hexagonit.recipe.cmmi
configure-options =
--disable-static
--with-libxml-prefix=${libxml2:location}
--without-crypto
--without-python
--without-debug
--without-debugger
[x86-linux-libxslt]
configure-options =
${libxslt:configure-options}
--with-libxml-prefix=${libxml2:location}
environment =
PATH=${pkgconfig:location}/bin:%(PATH)s
CPPFLAGS=-I${zlib:location}/include
......
......@@ -8,14 +8,14 @@ parts =
lxml-python
[lxml-python-env]
PATH = ${libxslt:location}/bin:${zlib:location}/bin:%(PATH)s
PATH = ${libxslt:prefix}/bin:${zlib:prefix}/bin:%(PATH)s
[lxml-python]
recipe = zc.recipe.egg:custom
egg = lxml
rpath =
${libxml2:location}/lib/
${libxslt:location}/lib/
${zlib:location}/lib/
${libxml2:prefix}/lib/
${libxslt:prefix}/lib/
${zlib:prefix}/lib/
environment = lxml-python-env
......@@ -10,6 +10,6 @@ download-only = true
filename = drop.gets.patch
[m4]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/m4/m4-1.4.16.tar.bz2
md5sum = 8a7cef47fecab6272eb86a6be6363b2f
......@@ -3,40 +3,26 @@
[buildout]
extends =
../bison/buildout.cfg
../cmake/buildout.cfg
../zlib/buildout.cfg
../groonga/buildout.cfg
../libaio/buildout.cfg
../libevent/buildout.cfg
../ncurses/buildout.cfg
../openssl/buildout.cfg
../pkgconfig/buildout.cfg
../readline/buildout.cfg
parts =
mariadb
[mariadb-5.5-no_test-patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
md5sum = 14e6d713c16298a10f40d29f2b799aca
filename = mariadb_5.5_create_system_tables__no_test.patch
download-only = true
parts = mariadb
[mariadb]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
version = 5.5.25
revision = 1
dependencies = cmake zlib libevent ncurses openssl pkgconfig readline bison
url = http://downloads.askmonty.org/f/mariadb-${:version}/kvm-tarbake-jaunty-x86/mariadb-${:version}.tar.gz/from/http://ftp.osuosl.org/pub/mariadb
md5sum = 943f67c267d73a4080ab497e11740daf
# compile directory is required to build mysql plugins.
keep-compile-dir = true
patch-options = -p0
patches =
${mariadb-5.5-no_test-patch:location}/${mariadb-5.5-no_test-patch:filename}
configure-command = ${cmake:location}/bin/cmake
configure-command = ${cmake:prefix}/bin/cmake
configure-options =
-DCMAKE_INSTALL_PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
-DCMAKE_INSTALL_PREFIX=%(prefix)s
-DBUILD_CONFIG=mysql_release
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_unicode_ci
......@@ -49,19 +35,37 @@ configure-options =
-DWITH_EMBEDDED_SERVER=0
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
-DWITHOUT_DAEMON_EXAMPLE=1
-DCMAKE_C_FLAGS="-I${libaio:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${readline5:location}/include -I${zlib:location}/include"
-DCMAKE_CXX_FLAGS="-I${libaio:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${readline5:location}/include -I${zlib:location}/include"
-DCMAKE_INSTALL_RPATH=${libaio:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${readline5:location}/lib:${zlib:location}/lib
environment =
CMAKE_PROGRAM_PATH=${cmake:location}/bin
CMAKE_INCLUDE_PATH=${libaio:location}/include:${ncurses:location}/include:${openssl:location}/include:${readline5:location}/include:${zlib:location}/include
CMAKE_LIBRARY_PATH=${libaio:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${readline5:location}/lib:${zlib:location}/lib
LDFLAGS=-L${libaio:location}/lib
patches =
${:_profile_base_location_}/mariadb_5.5_create_system_tables__no_test.patch
${:_profile_base_location_}/mariadb-5.5.25-no-mysql-test.patch
[x86-cygwin-mariadb]
patches =
${mariadb:patches}
${:_profile_base_location_}/cygwin-mariadb-5.5.25-no-threadpool.patch
post-install =
ln -fs %(prefix)s/lib/libmysqlclient.dll.a %(prefix)s/lib/libmysqlclient_r.dll.a
cp --preserve -f %(prefix)s/lib/cygmysqlclient-*.dll %(prefix)s/bin
[x86-linux-mariadb]
configure-options =
${mariadb:configure-options}
-DCMAKE_C_FLAGS="-I${ncurses:prefix}/include -I${openssl:prefix}/include -I${readline5:prefix}/include -I${zlib:prefix}/include"
-DCMAKE_CXX_FLAGS="-I${ncurses:prefix}/include -I${openssl:prefix}/include -I${readline5:prefix}/include -I${zlib:prefix}/include"
-DCMAKE_INSTALL_RPATH=${ncurses:prefix}/lib:${openssl:prefix}/lib:${readline5:prefix}/lib:${zlib:prefix}/lib
-DCMAKE_INSTALL_COMPONENT="Readme Server Client SharedLibraries SupportFiles Server_Scripts IniFiles Development SqlBench"
# Test
environment =
CMAKE_PROGRAM_PATH=${cmake:prefix}/bin
CMAKE_INCLUDE_PATH=${ncurses:prefix}/include:${openssl:prefix}/include:${readline5:prefix}/include:${zlib:prefix}/include
CMAKE_LIBRARY_PATH=${ncurses:prefix}/lib:${openssl:prefix}/lib:${readline5:prefix}/lib:${zlib:prefix}/lib
[mroonga-mariadb]
# mroonga - a storage engine for MySQL. It provides fast fulltext search feature to all MySQL users.
# http://mroonga.github.com/
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = https://github.com/downloads/mroonga/mroonga/mroonga-2.06.tar.gz
md5sum = 89ce640a57ed8f2161b8358ff4c29c66
configure-options =
......
diff --git sql/CMakeLists.txt sql/CMakeLists.txt
index ecf91fc..adbb7bb 100644
--- sql/CMakeLists.txt
+++ sql/CMakeLists.txt
@@ -31,7 +31,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1)
-ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER -DHAVE_POOL_OF_THREADS)
+ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER)
IF(SSL_DEFINES)
ADD_DEFINITIONS(${SSL_DEFINES})
ENDIF()
@@ -83,18 +83,11 @@ SET (SQL_SOURCE
opt_index_cond_pushdown.cc opt_subselect.cc
opt_table_elimination.cc sql_expression_cache.cc
gcalc_slicescan.cc gcalc_tools.cc
- threadpool_common.cc
../sql-common/mysql_async.c
${GEN_SOURCES}
${MYSYS_LIBWRAP_SOURCE}
)
-IF(WIN32)
- SET(SQL_SOURCE ${SQL_SOURCE} threadpool_win.cc)
-ELSE()
- SET(SQL_SOURCE ${SQL_SOURCE} threadpool_unix.cc)
-ENDIF()
-
MYSQL_ADD_PLUGIN(partition ha_partition.cc STORAGE_ENGINE DEFAULT STATIC_ONLY
RECOMPILE_FOR_EMBEDDED)
diff --git sql/scheduler.h sql/scheduler.h
index 82bba5a..fa38335 100644
--- sql/scheduler.h
+++ sql/scheduler.h
@@ -99,14 +99,7 @@ public:
void *data; /* scheduler-specific data structure */
};
-#if !defined(EMBEDDED_LIBRARY)
-#define HAVE_POOL_OF_THREADS 1
-void pool_of_threads_scheduler(scheduler_functions* func,
- ulong *arg_max_connections,
- uint *arg_connection_count);
-#else
#define pool_of_threads_scheduler(A,B,C) \
one_thread_per_connection_scheduler(A, B, C)
-#endif
#endif /* SCHEDULER_INCLUDED */
diff --git strings/dtoa.c strings/dtoa.c
index 6b21605..4bb5de9 100644
--- strings/dtoa.c
+++ strings/dtoa.c
@@ -51,7 +51,7 @@
#define DTOA_OVERFLOW 9999
static double my_strtod_int(const char *, char **, int *, char *, size_t);
-static char *dtoa(double, int, int, int *, int *, char **, char *, size_t);
+static char *x_dtoa(double, int, int, int *, int *, char **, char *, size_t);
static void dtoa_free(char *, char *, size_t);
/**
@@ -92,7 +92,7 @@ size_t my_fcvt(double x, int precision, char *to, my_bool *error)
char buf[DTOA_BUFF_SIZE];
DBUG_ASSERT(precision >= 0 && precision < NOT_FIXED_DEC && to != NULL);
- res= dtoa(x, 5, precision, &decpt, &sign, &end, buf, sizeof(buf));
+ res= x_dtoa(x, 5, precision, &decpt, &sign, &end, buf, sizeof(buf));
if (decpt == DTOA_OVERFLOW)
{
@@ -221,7 +221,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
if (x < 0.)
width--;
- res= dtoa(x, 4, type == MY_GCVT_ARG_DOUBLE ? width : min(width, FLT_DIG),
+ res= x_dtoa(x, 4, type == MY_GCVT_ARG_DOUBLE ? width : min(width, FLT_DIG),
&decpt, &sign, &end, buf, sizeof(buf));
if (decpt == DTOA_OVERFLOW)
{
@@ -327,7 +327,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
number of significant digits = (len-decpt) - (len-width) = width-decpt
*/
dtoa_free(res, buf, sizeof(buf));
- res= dtoa(x, 5, width - decpt, &decpt, &sign, &end, buf, sizeof(buf));
+ res= x_dtoa(x, 5, width - decpt, &decpt, &sign, &end, buf, sizeof(buf));
src= res;
len= end - res;
}
@@ -393,7 +393,7 @@ size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
{
/* Yes, re-convert with a smaller width */
dtoa_free(res, buf, sizeof(buf));
- res= dtoa(x, 4, width, &decpt, &sign, &end, buf, sizeof(buf));
+ res= x_dtoa(x, 4, width, &decpt, &sign, &end, buf, sizeof(buf));
src= res;
len= end - res;
if (--decpt < 0)
@@ -2166,7 +2166,7 @@ static int quorem(Bigint *b, Bigint *S)
calculation.
*/
-static char *dtoa(double dd, int mode, int ndigits, int *decpt, int *sign,
+static char *x_dtoa(double dd, int mode, int ndigits, int *decpt, int *sign,
char **rve, char *buf, size_t buf_size)
{
/*
--- CMakeLists.txt~ 2013-01-05 14:37:13.937500000 +0800
+++ CMakeLists.txt 2013-01-05 14:37:35.906250000 +0800
@@ -312,8 +312,6 @@
ADD_SUBDIRECTORY(libmysqld/examples)
ENDIF(WITH_EMBEDDED_SERVER)
- ADD_SUBDIRECTORY(mysql-test)
- ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
ADD_SUBDIRECTORY(support-files)
ADD_SUBDIRECTORY(scripts)
ADD_SUBDIRECTORY(sql-bench)
......@@ -3,21 +3,29 @@ parts =
ncurses
[ncurses]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = ftp://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
md5sum = 8cb9c412e5f2d96bc6f459aa8c6282a1
configure-options =
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--with-shared
--without-normal
--without-debug
--without-gpm
--enable-rpath
# tricky way to rerun with --enable-widec
make-targets =
install && (for i in curses unctrl eti form menu panel term; do ln -sf ncurses/$i.h ${buildout:parts-directory}/${:_buildout_section_name_}/include/$i.h; done; ln -sf libncurses.so ${buildout:parts-directory}/${:_buildout_section_name_}/lib/libcurses.so) && ./configure ${:configure-options} --enable-widec && make ${:make-options} install
make-targets = install && (for i in curses unctrl eti form menu panel term; do ln -sf ncurses/$i.h ${buildout:parts-directory}/${:_buildout_section_name_}/include/$i.h; done; ln -sf libncurses.so ${buildout:parts-directory}/${:_buildout_section_name_}/lib/libcurses.so) && ./configure ${:configure-options} --enable-widec && make ${:make-options} install
make-options =
-j1
[x86-cygwin-ncurses]
configure-options =
${ncurses:configure-options}
--with-libtool
make-targets = install && (for i in curses unctrl eti form menu panel term; do ln -sf ncurses/$i.h %(prefix)s/include/$i.h; done; ln -sf libncurses.dll.a %(prefix)s/lib/libcurses.dll.a) && CFLAGS="" CPPFLAGS="" CXXFLAGS="" ./configure --prefix=%(prefix)s ${ncurses:configure-options} --enable-widec && make install
[no-environment]
# pass dummy LDCONFIG to skip needless calling of ldconfig by non-root user
environment =
LDCONFIG=/bin/echo
make-options =
-j1
......@@ -7,47 +7,29 @@
extends =
../ca-certificates/buildout.cfg
../zlib/buildout.cfg
../patch/buildout.cfg
parts =
openssl
[openssl-nodoc.patch]
# Disable doc generation part in Makefile
recipe = hexagonit.recipe.download
md5sum = b4887a7b4e18402447bc6227d2493b92
url = ${:_profile_base_location_}/${:filename}
filename = ${:_buildout_section_name_}
download-only = true
[openssl-exlibs.patch]
recipe = hexagonit.recipe.download
md5sum = dfb8979460d6d75f2d23d1ea83bbb40a
url = ${:_profile_base_location_}/${:filename}
filename = ${:_buildout_section_name_}
download-only = true
[openssl]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies =
zlib
ca-certificates
url = https://www.openssl.org/source/openssl-1.0.1c.tar.gz
md5sum = ae412727c8c15b67880aef7bd2999b2e
patch-binary = ${patch:location}/bin/patch
patches =
${openssl-nodoc.patch:location}/${openssl-nodoc.patch:filename}
${openssl-exlibs.patch:location}/${openssl-exlibs.patch:filename}
patch-options = -p0
configure-command = ./config
configure-options =
-I${zlib:location}/include
-L${zlib:location}/lib
--openssldir=${buildout:parts-directory}/${:_buildout_section_name_}/etc/ssl
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
--prefix=%(prefix)s
--openssldir=%(prefix)s/etc/ssl
--libdir=lib
shared no-idea no-mdc2 no-rc5 zlib
-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${buildout:parts-directory}/${:_buildout_section_name_}/lib
# it seems that parallel build sometimes fails for openssl.
make-options =
-j1
make-targets =
install && rm -f ${buildout:parts-directory}/${:_buildout_section_name_}/etc/ssl/certs/* && for i in ${ca-certificates:location}/certs/*/*.crt; do ln -sv $i ${buildout:parts-directory}/${:_buildout_section_name_}/etc/ssl/certs/`${buildout:parts-directory}/${:_buildout_section_name_}/bin/openssl x509 -hash -noout -in $i`.0; done; true
post-install = rm -f %(prefix)s/etc/ssl/certs/* && for i in ${ca-certificates:prefix}/certs/*/*.crt; do ln -sv $i %(prefix)s/etc/ssl/certs/`%(prefix)s/bin/openssl x509 -hash -noout -in $i`.0; done; true
patches =
${:_profile_base_location_}/openssl-nodoc.patch#b4887a7b4e18402447bc6227d2493b92
${:_profile_base_location_}/openssl-exlibs.patch#dfb8979460d6d75f2d23d1ea83bbb40a
......@@ -3,6 +3,6 @@ parts =
patch
[patch]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = ftp://ftp.gnu.org/gnu/patch/patch-2.6.1.tar.gz
md5sum = d758eb96d3f75047efc004a720d33daf
......@@ -3,7 +3,7 @@ parts =
pcre
[pcre]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.21.tar.bz2
md5sum = 0a7b592bea64b7aa7f4011fc7171a730
configure-options =
......
......@@ -10,18 +10,25 @@ extends =
../popt/buildout.cfg
[pkgconfig]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies =
glib
popt
gettext
url = ftp://mirror.ovh.net/gentoo-distfiles/distfiles/pkg-config-0.26.tar.gz
md5sum = 47525c26a9ba7ba14bf85e01509a7234
location = ${buildout:parts-directory}/${:_buildout_section_name_}
# build pkg-config twice so that second configure can use pkg-config
# to compute GLIB_CFLAGS and GLIB_LIBS.
configure-command =
./configure --prefix=${:location} --with-installed-glib --with-installed-popt && make && make install && ./configure
pre-configure =
./configure --prefix=%(prefix)s --with-installed-glib --with-installed-popt && make && make install
configure-options =
--prefix=${:location}
--with-installed-glib
--with-installed-popt
environment =
GLIB_CFLAGS=-I${glib:prefix}/include/glib-2.0 -I${glib:prefix}/lib/glib-2.0/include
GLIB_LIBS=-L${glib:prefix}/lib -lglib-2.0 -lintl
[linux-pkgconfig]
environment =
PATH=${:location}/bin:%(PATH)s
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig
......
......@@ -3,8 +3,11 @@ parts =
popt
[popt]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = ftp://anduin.linuxfromscratch.org/BLFS/svn/p/popt-1.16.tar.gz
md5sum = 3743beefa3dd6247a73f8f7a32c14c33
configure-options =
--disable-static
[x86-cygwin-popt]
patches = ${:_profile_base_location_}/cygwin-popt-1.16-src.patch
\ No newline at end of file
--- poptconfig.c~ 2011-09-10 22:49:30.802250000 +0800
+++ poptconfig.c 2011-09-10 23:46:30.572048000 +0800
@@ -45,8 +45,9 @@ extern int glob_pattern_p (const char *_
#if !defined(__GLIBC__)
/* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
+#define glob_pattern_p glob_pattern_p_s
static int
-glob_pattern_p (const char * pattern, int quote)
+glob_pattern_p_s(const char * pattern, int quote)
/*@*/
{
const char * p;
......@@ -24,19 +24,15 @@ arguments = sys.argv[1:] + ["bootstrap"]
python = python2.7
[python2.7]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
package_version = 2.7.3
package_version_suffix =
md5sum = c57477edd6d18bd9eeca2f21add73919
depends =
${gdbm:version}
dependencies = bzip2 gdbm gettext libexpat ncurses openssl readline sqlite3 zlib file
# This is actually the default setting for prefix, but we can't use it in
# other settings in this part if we don't set it explicitly here.
prefix = ${buildout:parts-directory}/${:_buildout_section_name_}
version = 2.7
executable = ${:prefix}/bin/python${:version}
executable = %(prefix)s/bin/python${:version}
url =
http://python.org/ftp/python/${:package_version}/Python-${:package_version}${:package_version_suffix}.tar.bz2
configure-options =
......@@ -45,9 +41,11 @@ configure-options =
--with-system-expat
--with-threads
[x86-cygwin-python2.7]
patch-options = -p1
patches = /opt/patch/python-2.7.3-cygwin.patch
patches = ${:_profile_base_location_}/cygwin-python-2.7.3.patch
[x86-linux-python2.7]
# the entry "-Wl,-rpath=${file:location}/lib" below is needed by python-magic,
# which would otherwise load the system libmagic.so with ctypes
environment =
......
[buildout]
extends =
../ncurses/buildout.cfg
../ncurses/buildout.cfg
parts =
readline5
......@@ -8,7 +8,7 @@ parts =
# readline-5.x is still used for GPL2 only softwares.
[readline5]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
md5sum = e39331f32ad14009b9ff49cc10c5e751
configure-options =
......@@ -16,12 +16,10 @@ configure-options =
--disable-static
[readline]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies = ncurses
url = http://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz
md5sum = 67948acb2ca081f23359d0256e9a271c
configure-options =
--enable-multibyte
--disable-static
environment =
LDFLAGS=-L${ncurses:location}/lib
# This file is used to install SlapOS Node itself.
[buildout]
extends =
../../stack/shacache-client.cfg
......@@ -25,8 +24,7 @@ extends =
parts =
slapos
cfg-environment
sh-environment
slapos-patches
py
find-links =
......@@ -48,58 +46,39 @@ include-site-packages = false
exec-sitecustomize = false
allowed-eggs-from-site-packages =
[environment]
# Note: For now original PATH is appended to the end, as not all tools are
# provided by SlapOS
PATH=${bison:location}/bin:${bzip2:location}/bin:${gettext:location}/bin:${glib:location}/bin:${libxml2:location}/bin:${libxslt:location}/bin:${m4:location}/bin:${ncurses:location}/bin:${openssl:location}/bin:${pkgconfig:location}/bin:${python2.7:location}/bin:${readline:location}/bin:${sqlite3:location}/bin:${swig:location}/bin:${buildout:bin-directory}:${patch:location}/bin:${zlib:location}/bin:$PATH
CFLAGS=-I${bzip2:location}/include -I${gdbm:location}/include -I${gettext:location}/include -I${glib:location}/include -I${libxml2:location}/include -I${libxslt:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${popt:location}/include -I${readline:location}/include -I${sqlite3:location}/include -I${zlib:location}/include
CPPFLAGS=${:CFLAGS}
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${libxslt:location}/lib -Wl,-rpath=${libxslt:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${popt:location}/lib -Wl,-rpath=${popt:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${libxml2:location}/lib/pkgconfig:${libxslt:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${popt:location}/lib/pkgconfig:${python2.7:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig
LD_LIBRARY_PATH=${bzip2:location}/lib:${gdbm:location}/lib:${gettext:location}/lib:${glib:location}/lib:${libxml2:location}/lib:${libxslt:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${popt:location}/lib:${readline:location}/lib:${sqlite3:location}/lib:${zlib:location}/lib
[slapos-patches]
recipe =slapos.recipe.cmmi
url = file:///nothing/to/do
configure-command = true
make-binary = echo
make-options = slapos platform patches
compile-directory = ${buildout:parts-directory}/${:_buildout_section_name_}__compile__
[cfg-environment]
# Section exposes SlapOS default environment as configuration file.
recipe = collective.recipe.template
input = inline:
[environment]
PATH=${environment:PATH}
CFLAGS=${environment:CFLAGS}
CPPFLAGS=${environment:CPPFLAGS}
LDFLAGS=${environment:LDFLAGS}
PKG_CONFIG_PATH=${environment:PKG_CONFIG_PATH}
LD_LIBRARY_PATH=${environment:LD_LIBRARY_PATH}
output = ${buildout:directory}/environment.cfg
[cygwin-slapos-patches]
prefix = ${buildout:directory}/bin
url = ${:_profile_base_location_}/cygwin-pseudo-commands.tar.gz
md5sum = bc8b3e1579d47a46e5f21476841f8139
post-install = cp -a ${slapos-patches:compile-directory}/* ${:prefix}
[sh-environment]
# Section exposes SlapOS default environment as sh file.
recipe = collective.recipe.template
input = inline:
export PATH="${environment:PATH}"
export CFLAGS="${environment:CFLAGS}"
export CPPFLAGS="${environment:CPPFLAGS}"
export LDFLAGS="${environment:LDFLAGS}"
export PKG_CONFIG_PATH="${environment:PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH="${environment:LD_LIBRARY_PATH}"
export PS1="[SlapOS env Active] $PS1"
output = ${buildout:directory}/environment.sh
[slapos-python]
executable = ${python2.7:prefix}/bin/python2.7
[lxml-python]
python = python2.7
python = slapos-python
[slapos]
recipe = z3c.recipe.scripts
python = python2.7
python = slapos-python
eggs =
slapos.libnetworkcache
zc.buildout
${lxml-python:egg}
slapos.core
initialization =
import os
os.environ['PATH'] = os.path.expandvars('${environment:PATH}')
# initialization =
# import os
# os.environ['PATH'] = os.path.expandvars('${environment:PATH}')
#
# control scripts generation in order to avoid reinstalling bin/buildout
scripts =
bang = slapos.bang:main
......@@ -119,11 +98,11 @@ scripts =
[py]
recipe = zc.recipe.egg
eggs =
${slapos:eggs}
python = python2.7
python = slapos-python
interpreter = py
scripts = py
eggs =
${slapos:eggs}
[versions]
# Use our own buildout version
......@@ -171,3 +150,40 @@ supervisor = 3.0b1
# Required by:
# slapos.core==0.33.1
zope.interface = 4.0.1
[environment]
# Note: For now original PATH is appended to the end, as not all tools are
# provided by SlapOS
PATH=${bison:location}/bin:${bzip2:location}/bin:${gettext:location}/bin:${glib:location}/bin:${libxml2:location}/bin:${libxslt:location}/bin:${m4:location}/bin:${ncurses:location}/bin:${openssl:location}/bin:${pkgconfig:location}/bin:${python2.7:location}/bin:${readline:location}/bin:${sqlite3:location}/bin:${swig:location}/bin:${buildout:bin-directory}:${patch:location}/bin:${zlib:location}/bin:$PATH
CFLAGS=-I${bzip2:location}/include -I${gdbm:location}/include -I${gettext:location}/include -I${glib:location}/include -I${libxml2:location}/include -I${libxslt:location}/include -I${ncurses:location}/include -I${openssl:location}/include -I${popt:location}/include -I${readline:location}/include -I${sqlite3:location}/include -I${zlib:location}/include
CPPFLAGS=${:CFLAGS}
LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath=${bzip2:location}/lib -L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${glib:location}/lib -Wl,-rpath=${glib:location}/lib -L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib -L${libxslt:location}/lib -Wl,-rpath=${libxslt:location}/lib -L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib -L${popt:location}/lib -Wl,-rpath=${popt:location}/lib -L${readline:location}/lib -Wl,-rpath=${readline:location}/lib -L${sqlite3:location}/lib -Wl,-rpath=${sqlite3:location}/lib -L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib
PKG_CONFIG_PATH=${glib:location}/lib/pkgconfig:${libxml2:location}/lib/pkgconfig:${libxslt:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${popt:location}/lib/pkgconfig:${python2.7:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig
LD_LIBRARY_PATH=${bzip2:location}/lib:${gdbm:location}/lib:${gettext:location}/lib:${glib:location}/lib:${libxml2:location}/lib:${libxslt:location}/lib:${ncurses:location}/lib:${openssl:location}/lib:${popt:location}/lib:${readline:location}/lib:${sqlite3:location}/lib:${zlib:location}/lib
[cfg-environment]
# Section exposes SlapOS default environment as configuration file.
recipe = collective.recipe.template
input = inline:
[environment]
PATH=${environment:PATH}
CFLAGS=${environment:CFLAGS}
CPPFLAGS=${environment:CPPFLAGS}
LDFLAGS=${environment:LDFLAGS}
PKG_CONFIG_PATH=${environment:PKG_CONFIG_PATH}
LD_LIBRARY_PATH=${environment:LD_LIBRARY_PATH}
output = ${buildout:directory}/environment.cfg
[sh-environment]
# Section exposes SlapOS default environment as sh file.
recipe = collective.recipe.template
input = inline:
export PATH="${environment:PATH}"
export CFLAGS="${environment:CFLAGS}"
export CPPFLAGS="${environment:CPPFLAGS}"
export LDFLAGS="${environment:LDFLAGS}"
export PKG_CONFIG_PATH="${environment:PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH="${environment:LD_LIBRARY_PATH}"
export PS1="[SlapOS env Active] $PS1"
output = ${buildout:directory}/environment.sh
##############################################################################
#
# Copyright (c) 2010, 2011, 2012 Vifib SARL and Contributors.
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
# for debug installer
# trap "sleep 30" EXIT
function usage()
{
echo "Usage: configure.sh COMPUTER_ID [ KEY CERTIFICATE ]
For example:
$ /configure.sh COMP-161
$ /configure.sh COMP-161 ~/computer.key ~/computer.crt"
}
# return all the interface's GUID
function get_all_interface()
{
/opt/slapos/bin/py -c "from netifaces import interfaces
print '\n'.join(interfaces())"
}
# return GUID of physical netcard only
#
# Get the value of Characteristics of each interface,
#
# Characteristics & NCF_VIRTUAL == NCF_VIRTUAL
# Characteristics & NCF_PHYSICAL == NCF_PHYSICAL
#
function get_all_physical_netcard()
{
local -r NCF_VIRTUAL=1
local -r NCF_PHYSICAL=4
local -r NCF_HIDDEN=8
local -r NCF_HAS_UI=0x80
local -r NCF_EXPECTED=$((NCF_PHYSICAL | NCF_HAS_UI))
key='\HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}'
for subkey in $(regtool -q list "$key") ; do
local -i flags=$(regtool -q get "$key\\$subkey\Characteristics")
if (( (flags & NCF_EXPECTED) == NCF_EXPECTED )) ; then
echo $(regtool -q get "$key\\$subkey\NetCfgInstanceId")
fi
done
}
#
# DriverDesc == TAP-Win32 Adapter V9
#
function get_openvpn_tap_interface()
{
key='\HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}'
for subkey in $(regtool -q list "$key") ; do
desc=$(regtool -q get "$key\\$subkey\DriverDesc")
if [[ "$desc" == "TAP-Win32 Adapter V9" ]] ; then
echo $(regtool -q get "$key\\$subkey\NetCfgInstanceId")
break
fi
done
}
# get connection name by IF_GUID
function get_connection_name()
{
key='\HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002bE10318}'
echo $(regtool -q get "$key\\$IF_GUID\Connection\Name")
}
# tell the ip version
#
# 0 None
# 1 ipv4
# 2 ipv6
# 3 mixed
#
function get_local_ip_version()
{
gateways=`ipconfig /all | grep "Gateway" | sed -e "s/^\\s\+Default Gateway[. :]\+//g"`
ipv4flag=$(echo $gateways | grep ".")
ipv6flag=$(echo $gateways | grep ":")
if [[ "$ipv4flag" != "" ]] ; then
local_ip_version=$((local_ip_version | 1))
fi
if [[ "$ipv6flag" != "" ]] ; then
local_ip_version=$((local_ip_version | 2))
fi
}
#
# Tell by getmac, if GUID can be found, it's ok, else disabled or not connected
function get_interface_state()
{
getmac /V /FO list | grep "${INTERFACENAME}"
return $?
}
# test code
# slist=$(get_all_physical_netcard)
# echo physical netcards: $slist
# for s in $slist ; do
# INTERFACE_NAME=$s
# echo conn name is $(get_connection_name)
# done
# get_local_ip_version
# echo version is $local_ip_version
# for s in $(get_all_interface) ; do
# INTERFACE_NAME=$s
# get_connection_name
# echo conn name is $(get_connection_name)
# done
# echo openvpn tap interface is $(get_openvpn_tap_interface)
# exit 0
#
# main entry, first initialize variable
#
WINSYS32HOME="$(/usr/bin/cygpath -S -w)"
CYGWINSYS32HOME="$(/usr/bin/cygpath -S)"
DESTKEYFILE=/etc/slapos/ssl/computer.key
DESTCERTFILE=/etc/slapos/ssl/computer.crt
IPV6=${CYGWINSYS32HOME}/ipv6.exe
NETSH=${CYGWINSYS32HOME}/netsh.exe
IPCONFIG=${CYGWINSYS32HOME}/ipconfig.exe
GETMAC=${CYGWINSYS32HOME}/getmac.exe
OPENVPNHOME=/opt/openvpn
SLAPOSCFG=/etc/slapos/slapos.cfg
declare -i local_ip_version=0
error_code=0
# remove startup item first.
RUNKEY='\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run'
SLAPOSNODEINIT=SlapOSNodeInit
regtool -q unset "$RUNKEY\\$SLAPOSNODEINIT"
if (( $# != 1 && $# != 3 )) ; then
usage
exit 1
fi
which slapformat 2>/dev/null 1>/dev/null
if (( $? )) ; then
echo "Run this script must be in the SlapOS environments, do first:
\$ cd /opt/slapos
\$ source environment.sh"
cd /opt/slapos
source ./environment.sh
fi
COMPUTERID=$1
if [[ "$COMPUTERID" == "" ]] ; then
grep "^\\s\+computer_id\\s\+=\\s\+[-a-zA-Z0-9]\+" $SLAPOSCFG
if (( $? )) ; then
echo No computer id.
error_code=1
fi
elif [[ ${COMPUTERID:0:5} != "COMP-" ]] ; then
echo Invalide computer id \"$COMPUTERID\", it should be like \"COMP-XXX\"
error_code=1
fi
if [[ "$2" != "" ]] ; then
KEYFILE=$(cygpath -u "$2")
fi
if [[ "$3" != "" ]] ; then
CERTFILE=$(cygpath -u "$3")
fi
# check netsh
[ -f ${NETSH} ] || (echo "Error: unable to find command: netsh" && exit 1)
[ -f ${IPCONFIG} ] || (echo "Error: unable to find command: ipconfig" && exit 1)
[ -f ${GETMAC} ] || (echo "Error: unable to find command: getmac" && exit 1)
[ -f ${IPV6} ] || (echo "Error: unable to find command: ipv6" && exit 1)
# check ipv6
get_local_ip_version
if (( (local_ip_version & 2) == 0 )) ; then
echo "Install ipv6, maybe you need specify the location of windows setup pacakge ..."
netsh interface ipv6 install
fi
# get GUID of the first physics netcard
for IPINTERFACE in $(get_all_physical_netcard) ; do
break ;
done
# check to support native ipv6, if not, openvpn is necessary
IPV6INTERFACE=
declare -i openvpn_required=$((local_ip_version != 2))
if (( openvpn_required )) ; then
echo OpenVPN is required because of no native ipv6.
echo Check OpenVPN TAP Driver ...
getmac -v -Fo list | grep "TAP-Win32 Adapter V9" > /dev/null
if (( $? )) ; then
echo Install OpenVPN TAP driver as tap0901 ...
(cd ${OPENVPNHOME}/driver ; ./tapinstall.exe install OemWin2k.inf tap0901)
echo OpenVPN TAP driver Installed.
else
echo OpenVPN TAP Driver has been installed before.
fi
# echo Try to get OpenVPN TAP driver\'s connection name ...
# CONNAME=$(getmac -v -Fo list | grep -B1 "TAP-Win32 Adapter V9" | \
# sed -e "2d" | sed -e "s/Connection Name:\\s+//g")
# if [[ "${CONNAME}" == "" ]] ; then
# echo "Can't find connection name of TAP driver."
# exit 1
# fi
# echo TAP driver\'s connection name is "${CONNAME}"
echo Try to get OpenVPN TAP driver\'s GUID ...
# IPV6INTERFACE=$(ipv6 if | \
# grep -A1 "^Interface [0-9]+: Ethernet: ${CONNECTION}" | \
# sed -e "1d" | sed -e "s/\\s+Guid\\s+//g")
IPV6INTERFACE=$(get_openvpn_tap_interface)
if [[ "${IPV6INTERFACE}" == "" ]] ; then
echo "Can't get interface name of TAP driver."
exit 1
fi
echo Got it: ${IPV6INTERFACE}
fi
# check key, crt
if [[ -f "${KEYFILE}" && ! "${KEYFILE}" -ef ${DESTKEYFILE} ]] ; then
echo Copy ${KEYFILE} to ${DESTKEYFILE}
cp ${KEYFILE} ${DESTKEYFILE}
chmod 644 ${DESTKEYFILE}
fi
if [[ -f "${CERTFILE}" && ! "${CERTFILE}" -ef ${DESTCERTFILE} ]] ; then
echo Copy ${CERTFILE} to ${DESTCERTFILE}
cp ${CERTFILE} ${DESTCERTFILE}
chmod 644 ${DESTCERTFILE}
fi
[ -f ${DESTCERTFILE} ] || (echo "Error: unable to find $DESTCERTFILE file." && error_code=1)
[ -f ${DESTKEYFILE} ] || (echo "Error: unable to find $DESTKEYFILE file." && error_code=1)
# generate /etc/slapos/slapos.cfg
[ "${COMPUTERID}" == "" ] || \
sed -i "s/^\\s*computer_id.*$/computer_id = ${COMPUTERID}/g" ${SLAPOSCFG}
[ "${IPINTERFACE}" == "" ] || \
sed -i "s/^\\s*interface_name.*$/interface_name = ${IPINTERFACE}/g" ${SLAPOSCFG}
[ "${IPV6INTERFACE}" == "" ] || \
sed -i "s/^#\?\\s*ipv6_interface.*$/ipv6_interface = ${IPV6INTERFACE}/g" ${SLAPOSCFG}
echo Set slapos init script as Windows startup item.
regtool -q set "$RUNKEY\\$SLAPOSNODEINIT" "\"$(cygpath -w /usr/bin/sh)\" --login -i /slapnode-init.sh"
(( $? )) && echo Fail to set init script as startup item.
if (( error_code )) ; then
echo Fail to configure SlapOS node, you need run this scripts again after fix the problems.
else
echo Configure SlapOS node successfully.
fi
exit $error_code
--- glib/gstrfuncs.c~ 2011-09-10 22:57:34.802250000 +0800
+++ glib/gstrfuncs.c 2011-09-10 22:57:52.630375000 +0800
@@ -1424,7 +1424,7 @@ g_strsignal (gint signum)
const char *msg_locale;
#if defined(G_OS_BEOS) || defined(G_WITH_CYGWIN)
-extern const char *strsignal(int);
+extern char *strsignal(int);
#else
/* this is declared differently (const) in string.h on BeOS */
extern char *strsignal (int sig);
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010, 2011, 2012 Vifib SARL and Contributors.
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
# Simulate the command groupadd to add a group on the Windows
#
ACTION=ADD
GROUP_NAME="$1"
NET LOCALGROUP ${GROUP_NAME} /${ACTION}
mkgroup > /etc/group
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010, 2011, 2012 Vifib SARL and Contributors.
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
if [[ "$1" == "" ]]; then
exit 1
fi
GUID=$1
ipv6 if | grep -B1 "$GUID" | sed -e "2d" | sed -e "s/^Interface[0-9: ]\+\(Ethernet: \)\?//g"
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010, 2011, 2012 Vifib SARL and Contributors.
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
# Simulate the command ip of Linux by netsh on the Windows.
#
# Usage: bash ip ...
#
#
# ip addr list INTERFACE_NAME
#
# => netsh interface ip show address [[name=]InterfaceName]
#
# ip link set INTERFACE_NAME up
#
# => netsh interface set interface [name = ] INTERFACE_NAME
# [ [admin = ] ENABLED|DISABLED
# [connect = ] CONNECTED|DISCONNECTED
# [newname = ] NewName ]
#
#
# ip addr add ADDRESS_STRING dev INTERFACE_NAME
#
# => netsh interface ip add address [name=]InterfaceName [addr=]IPAddress
# [mask=]SubnetMask [[gateway=] DefaultGateway [gwmetric=]GatewayMetric]
#
# ip addr del ADDRESS_STRING dev INTERFACE_NAME
#
# => netsh interface ip delete address [name=]InterfaceName [addr=] IPAddress
# [[gateway=]{DefaultGateway | all}]
#
function transfercommand()
{
IPCMD=`py -c "from netaddr.strategy import ipv4, ipv6
addr, prefix = '$ADDRESS_STRING'.split('/')
result = ''
if '.' in addr:
mask = ipv4.int_to_str(ipv4.prefix_to_netmask[int(prefix)])
if '$ACTION' == 'ADD':
if prefix == '32':
mask = '255.255.255.254'
result = 'netsh interface ip add address name=\"$INTERFACE_NAME\" addr=%s mask=%s' % (addr, mask)
elif '$ACTION' == 'DELETE':
result = 'netsh interface ip delete address name=\"$INTERFACE_NAME\" addr=%s' % addr
else:
mask = ipv6.int_to_str(ipv6.prefix_to_netmask[int(prefix)])
if '$ACTION' == 'ADD':
result = 'netsh interface ipv6 add address interface=\"$INTERFACE_NAME\" address=%s' % addr
elif '$ACTION' == 'DELETE':
result = 'netsh interface ipv6 delete address interface=\"$INTERFACE_NAME\" address=%s' % addr
print result"`
}
if [[ "$1" == "addr" ]]; then
if [[ "$2" == "list" ]]; then
INTERFACE_NAME=`guid2name $3`
# getmac /V /FO table /NH | grep "${INTERFACE_NAME}" | sed -e "s/Disable/Down/g" | sed -e "s/Enbale/Up/g"
# netsh interface ip show address name="${INTERFACE_NAME}"
ipconfig /all | gawk "BEGIN { ok = 0; flag = 0; }; /adapter $INTERFACE_NAME/ { ok = 1; }; /^\\s*\$/ { if (ok) flag += 1; if (flag == 2) { flag = 0; ok = 0; } }; { if (ok == 1) print \$0 }" | grep "IP Address"
netsh interface ipv6 show address interface="${INTERFACE_NAME}"
true
elif [[ "$2" == "add" ]]; then
ADDRESS_STRING="$3"
ACTION=ADD
INTERFACE_NAME=`guid2name $5`
transfercommand
$IPCMD
elif [[ "$2" == "del" ]]; then
ADDRESS_STRING="$3"
ACTION=DELETE
INTERFACE_NAME=`guid2name $5`
transfercommand
$IPCMD
fi
elif [[ "$1" == "link" ]]; then
INTERFACE_NAME=`guid2name $4`
netsh interface set interface "${INTERFACE_NAME}" enabled connected
fi
# Restart openvpn and slapos-node, this script will wait for ipv6 to
# be ready and run slapformat. After the first run of slapformat, the
# server on which slapformat was run and its partitions should appear
# on www.slapos.org.
# for debug installer
# trap "sleep 30" EXIT
function is_openvpn_disconnected()
{
getmac /V /FO list | grep "$IPV6INTERFACE" > /dev/null
# return $?
# 0 (false), connected
# 1 (true), disconnected or disabled
}
# get connection name by IF_GUID
function get_connection_name()
{
key='\HKLM\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002bE10318}'
echo $(regtool -q get "$key\\$IPV6INTERFACE\Connection\Name")
}
#
# This script will be executed background.
#
SLAPOSCFG=/etc/slapos/slapos.cfg
OPENVPNHOME=/opt/openvpn
OPENVPNCFG=vifib.ovpn
LOGFILE=openvpn-vifib.log
# Startup openvpn if necessary
echo Check ipv6 interface
IPV6INTERFACE=$(grep "^\\s*ipv6_interface\\s*=\\s*[-{}0-9a-zA-Z]\+" $SLAPOSCFG | \
sed -e "s/\\s*ipv6_interface\\s*=\\s*//g"| sed -e "s/ //g")
echo ipv6 interface is $IPV6INTERFACE
if [[ "$IPV6INTERFACE" != "" ]] ; then
echo Check Vifib OpenVPN status ...
# if openvpn is not up, start it
is_openvpn_disconnected
if (( $? )) ; then
cd $OPENVPNHOME/config
./openvpn.exe --log "$LOGFILE" --dev-node $IPV6INTERFACE --config $OPENVPNCFG &
# make sure the last backgroud process is openvpn
ps -s -p "$i" | grep "config/openvpn" > /dev/null
(( $? )) || OPENVPN_PID=$!
fi
# waiting for openvpn up, no more than 3 minutes
for (( i = 1; i < 6; i += 1 )) ; do
is_openvpn_disconnected
(( $? )) || break
echo Vifib OpenVPN is down, re-try after 10 seconds \($i of 6\) ...
sleep 10
done
# last check
is_openvpn_disconnected
if (( $? )) ; then
if [[ "$OPENVPN_PID" != "" ]] ; then
echo Kill process of Vifib OpenVPN: $OPENVPN_PID
kill -9 $OPENVPN_PID
fi
echo Error: Vifib OpenVPN can not be up, check your network and try it later.
exit 1
fi
echo Vifib OpenVPN is up on \"$(get_connection_name)\"
echo Vifib OpenVPN Process Info:
ps -s -p ${OPENVPN_PID:-*}
[ "$OPENVPN_PID" == "" ] || disown
# kill -9 $OPENVPN_PID
fi
cd /opt/slapos
which slapformat 2>/dev/null 1>/dev/null
if (( $? )) ; then
source ./environment.sh
fi
# Run slapformat
echo Running slapformat to initialize slapos node ...
echo bin/slapformat -c --now $SLAPOSCFG
echo
# bin/slapformat -c --now $SLAPOSCFG
echo
echo Now slapformat finished.
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010, 2011, 2012 Vifib SARL and Contributors.
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
#
# Simulate the command useradd to add a user on the Cygwin
# useradd -d path -g init-group -s /bin/false -G group NAME
#
# -g, --gid GROUP
# The group name or number of the user's new initial login group. The group must exist.
#
# -G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
# A list of supplementary groups which the user is also a member of.
# -s
# Shell used by user
#
ACTION=ADD
while getopts "Dd:g:G:p:s:r" opt ; do
case $opt in
d) USER_HOME=$OPTARG
;;
g,G) USER_GROUP=$OPTARG
;;
p) USER_PASSWORD=$OPTARG
;;
s) ;;
r) ;;
\?) echo Error when add user by cygwin
exit 1
;;
esac
done
shift $(($OPTIND - 1))
USER_NAME=$1
NET USER ${USER_NAME} ${USER_NAME} /${ACTION}
mkpasswd > /etc/passwd
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010, 2011, 2012 Vifib SARL and Contributors.
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly advised to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
#
# Simulate the command useradd to add a user on the Cygwin
# useradd -d path -g init-group -s /bin/false -G group NAME
#
# -g, --gid GROUP
# The group name or number of the user's new initial login group. The group must exist.
#
# -G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
# A list of supplementary groups which the user is also a member of.
# -s
# Shell used by user
#
ACTION=ADD
while getopts "Dd:g:G:p:s:r" opt ; do
case $opt in
d) USER_HOME=$OPTARG
;;
g,G) USER_GROUP=$OPTARG
;;
p) USER_PASSWORD=$OPTARG
;;
s) ;;
r) ;;
\?) echo Error when add user by cygwin
exit 1
;;
esac
done
shift $(($OPTIND - 1))
USER_NAME=$1
# NET USER ${USER_NAME} ${USER_NAME} /${ACTION}
mkpasswd > /etc/passwd
diff --git a/slapos/grid/slapgrid.py b/slapos/grid/slapgrid.py
index 7d19da6..7c7df51 100644
--- a/slapos/grid/slapgrid.py
+++ b/slapos/grid/slapgrid.py
@@ -532,6 +532,32 @@ class Slapgrid(object):
self.checkEnvironmentAndCreateStructure()
logger = logging.getLogger('SoftwareReleases')
logger.info("Processing software releases...")
+
+ if self.software_release_filter_list:
+ software_release_uri = self.software_release_filter_list[0]
+ url_hash = md5(software_release_uri).hexdigest()
+ software_path = os.path.join(self.software_root, url_hash)
+ software = Software(url=software_release_uri,
+ software_root=self.software_root,
+ buildout=self.buildout,
+ signature_private_key_file=self.signature_private_key_file,
+ signature_certificate_list=self.signature_certificate_list,
+ download_binary_cache_url=self.download_binary_cache_url,
+ upload_binary_cache_url=self.upload_binary_cache_url,
+ download_from_binary_cache_url_blacklist=\
+ self.download_from_binary_cache_url_blacklist,
+ upload_to_binary_cache_url_blacklist=\
+ self.upload_to_binary_cache_url_blacklist,
+ upload_cache_url=self.upload_cache_url,
+ download_binary_dir_url=self.download_binary_dir_url,
+ upload_binary_dir_url=self.upload_binary_dir_url,
+ upload_dir_url=self.upload_dir_url,
+ shacache_cert_file=self.shacache_cert_file,
+ shacache_key_file=self.shacache_key_file,
+ shadir_cert_file=self.shadir_cert_file,
+ shadir_key_file=self.shadir_key_file)
+ software.install()
+
# Boolean to know if every instance has correctly been deployed
clean_run = True
for software_release in self.computer.getSoftwareReleaseList():
@@ -659,7 +685,7 @@ class Slapgrid(object):
process_handler = subprocess.Popen(command,
preexec_fn=lambda: dropPrivileges(uid, gid),
cwd=cwd,
- env={}, **kw)
+ env=None, **kw)
process_handler.stdin.flush()
process_handler.stdin.close()
process_handler.stdin = None
@@ -697,7 +723,7 @@ class Slapgrid(object):
# If so, if current partition not in this list, skip.
if len(self.computer_partition_filter_list) > 0 and \
(computer_partition_id not in self.computer_partition_filter_list):
- return
+ pass # return
logger.info('Processing Computer Partition %s...' % computer_partition_id)
@@ -872,11 +898,40 @@ class Slapgrid(object):
exception)
return filtered_computer_partition_list
-
+
def processComputerPartitionList(self):
"""
Will start supervisord and process each Computer Partition.
"""
+ class PseudoComputerPartition(object):
+ def getId(self):
+ return "slappart0"
+ def getCertificate(self):
+ f = open("/etc/slapos/ssl/computer.key", "rb")
+ key = f.read()
+ f.close()
+ f = open("/etc/slapos/ssl/computer.crt", "rb")
+ crt = f.read()
+ f.close()
+ return { 'key' : key, 'certificate' : crt }
+ def getState(self):
+ return 'started'
+ def started(self):
+ print('instance started!')
+ def available(self):
+ print('instance available!')
+ def getSoftwareRelease(xself):
+ class SoftwareRelease(object):
+ def getURI(xself):
+ return self.computer_partition_filter_list[0]
+ return SoftwareRelease()
+ def getInstanceParameterDict(self):
+ return {'slap_software_type': 'default',
+ 'ip_list' : [('ipv6', '2001:380:e0c:155:6046:52ec:32eb:7f96')],
+ }
+ def error(self, exception):
+ print(exception)
+
logger = logging.getLogger('ComputerPartitionProcessing')
logger.info('Processing computer partitions...')
# Prepares environment
@@ -891,7 +946,8 @@ class Slapgrid(object):
# Filter all dummy / empty partitions
computer_partition_list = self.FilterComputerPartitionList(
self.getComputerPartitionList())
-
+ if self.computer_partition_filter_list:
+ computer_partition_list = [PseudoComputerPartition()]
for computer_partition in computer_partition_list:
# Nothing should raise outside of the current loop iteration, so that
# even if something is terribly wrong while processing an instance, it
@@ -1213,12 +1269,13 @@ class Slapgrid(object):
computer_partition.error(issue)
report_usage_issue_cp_list.append(computer_partition_id)
for computer_partition in computer_partition_list:
+ break
if computer_partition.getState() == COMPUTER_PARTITION_DESTROYED_STATE:
try:
computer_partition_id = computer_partition.getId()
try:
- software_url = computer_partition.getSoftwareRelease().getURI()
- software_path = os.path.join(self.software_root,
+ software_url = computer_partition.getSoftwareRelease().getURI()
+ software_path = os.path.join(self.software_root,
getSoftwareUrlHash(software_url))
except (NotFoundError, TypeError):
software_url = None
[buildout]
extends = ../readline/buildout.cfg
extends =
../readline/buildout.cfg
../ncurses/buildout.cfg
parts =
sqlite3
[sqlite3]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
dependencies =
readline
ncurses
url = http://www.sqlite.org/sqlite-autoconf-3071300.tar.gz
md5sum = c97df403e8a3d5b67bb408fcd6aabd8e
configure-options =
--disable-static
--enable-readline
environment =
CPPFLAGS=-I${readline:location}/include -I${ncurses:location}/include
CFLAGS=-mno-cygwin
LDFLAGS=-L${buildout:parts-directory}/${:_buildout_section_name_} -Wl,-rpath=${readline:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${readline:location}/lib -L${ncurses:location}/lib
--enable-readline
[x86-cygwin-sqlite3]
patch-options = -p2
patches = ${:_profile_base_location_}/cygwin-sqlite3-3.7.13-1.src.patch
\ No newline at end of file
--- origsrc/sqlite-autoconf-3071300/sqlite3.c 2012-06-11 03:33:44.000000000 -0600
+++ src/sqlite-autoconf-3071300/sqlite3.c 2012-08-08 13:24:18.185000000 -0600
@@ -36161,7 +36161,7 @@ static int winFullPathname(
*/
char zOut[MAX_PATH+1];
memset(zOut, 0, MAX_PATH+1);
- cygwin_conv_to_win32_path(zRelative, zOut); /* POSIX to Win32 */
+ cygwin_conv_path(CCP_POSIX_TO_WIN_A, zRelative, zOut, sizeof(zOut));
sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s\\%s",
sqlite3_data_directory, zOut);
}else{
@@ -36170,7 +36170,7 @@ static int winFullPathname(
** for the buffer passed to cygwin_conv_to_full_win32_path
** is MAX_PATH.
*/
- cygwin_conv_to_full_win32_path(zRelative, zFull);
+ cygwin_conv_path(CCP_POSIX_TO_WIN_A, zRelative, zFull, nFull);
}
return SQLITE_OK;
#endif
......@@ -8,12 +8,11 @@ parts =
swig
[swig]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://downloads.sourceforge.net/project/swig/swig/swig-1.3.40/swig-1.3.40.tar.gz
md5sum = 2df766c9e03e02811b1ab4bba1c7b9cc
configure-options =
--disable-ccache
--with-python=${buildout:executable}
--without-allegrocl
--without-chicken
--without-clisp
......@@ -32,5 +31,10 @@ configure-options =
--without-r
--without-ruby
--without-tcl
[x86-linux-swig]
environment =
PATH = ${bison:location}/bin:%(PATH)s
configure-options =
${swig:configure-options}
--with-python=${buildout:executable}
......@@ -2,9 +2,8 @@
parts = zip
[zip]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://sourceforge.net/projects/infozip/files/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz/download
md5sum = 7b74551e63f8ee6aab6fbc86676c0d37
location = ${buildout:parts-directory}/${:_buildout_section_name_}
configure-command = true
make-options = prefix=${:location} NO_BZIP2_SUPPORT=1 -f unix/Makefile generic
make-options = prefix=%(prefix)s NO_BZIP2_SUPPORT=1 -f unix/Makefile generic
......@@ -3,14 +3,15 @@ parts =
zlib
[zlib]
recipe = hexagonit.recipe.cmmi
recipe = slapos.recipe.cmmi
url = http://prdownloads.sourceforge.net/libpng/zlib-1.2.6.tar.bz2?download
md5sum = dc2cfa0d2313ca77224b4d932b2911e9
[x86-cygwin-zlib]
configure-command = make -f win32/Makefile.gcc
homedir = ${buildout:parts-directory}/${:_buildout_section_name_}
make-options = -fwin32/Makefile.gcc SHARED_MODE=1
INCLUDE_PATH=${:homedir}/include
LIBRARY_PATH=${:homedir}/lib
BINARY_PATH=${:homedir}/bin
make-options =
-fwin32/Makefile.gcc
SHARED_MODE=1
INCLUDE_PATH=%(prefix)s/include
LIBRARY_PATH=%(prefix)s/lib
BINARY_PATH=%(prefix)s/bin
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
# will be interpreted as '/logs/access_log'.
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
ServerRoot "${apache-config:httpd-base}"
#
# Mutex: Allows you to set the mutex mechanism and mutex file directory
# for individual mutexes, or change the global defaults
#
# Uncomment and change the directory if mutexes are file-based and the default
# mutex file directory is not on a local disk or is not appropriate for some
# other reason.
#
# Mutex default:logs
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 127.0.0.1:${apache-config:httpd-port}
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_socache_module modules/mod_authn_socache.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
#LoadModule authz_dbd_module modules/mod_authz_dbd.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_form_module modules/mod_auth_form.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule allowmethods_module modules/mod_allowmethods.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cache_disk_module modules/mod_cache_disk.so
#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
#LoadModule socache_dbm_module modules/mod_socache_dbm.so
#LoadModule socache_memcache_module modules/mod_socache_memcache.so
LoadModule watchdog_module modules/mod_watchdog.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule bucketeer_module modules/mod_bucketeer.so
#LoadModule dumpio_module modules/mod_dumpio.so
#LoadModule echo_module modules/mod_echo.so
#LoadModule case_filter_module modules/mod_case_filter.so
#LoadModule case_filter_in_module modules/mod_case_filter_in.so
#LoadModule buffer_module modules/mod_buffer.so
#LoadModule data_module modules/mod_data.so
#LoadModule ratelimit_module modules/mod_ratelimit.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule request_module modules/mod_request.so
#LoadModule include_module modules/mod_include.so
LoadModule filter_module modules/mod_filter.so
#LoadModule reflector_module modules/mod_reflector.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_debug_module modules/mod_log_debug.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
#LoadModule remoteip_module modules/mod_remoteip.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
#LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_express_module modules/mod_proxy_express.so
#LoadModule session_module modules/mod_session.so
#LoadModule session_cookie_module modules/mod_session_cookie.so
#LoadModule session_dbd_module modules/mod_session_dbd.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule optional_hook_export_module modules/mod_optional_hook_export.so
#LoadModule optional_hook_import_module modules/mod_optional_hook_import.so
#LoadModule optional_fn_import_module modules/mod_optional_fn_import.so
#LoadModule optional_fn_export_module modules/mod_optional_fn_export.so
#LoadModule dialup_module modules/mod_dialup.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
LoadModule unixd_module modules/mod_unixd.so
#LoadModule heartbeat_module modules/mod_heartbeat.so
#LoadModule heartmonitor_module modules/mod_heartmonitor.so
#LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule asis_module modules/mod_asis.so
#LoadModule info_module modules/mod_info.so
#LoadModule cgid_module modules/mod_cgid.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
#LoadModule actions_module modules/mod_actions.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module modules/libphp5.so
PHPIniDir "${layout:etc}"
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
#User daemon
#Group daemon
</IfModule>
# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
ServerAdmin whoami@example.com
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride none
Require all denied
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "${apache-config:httpd-docs}"
<Directory "${apache-config:httpd-docs}">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ".ht*">
Require all denied
</Files>
#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog "${layout:etc}/logs/error_log"
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog "${layout:etc}/logs/access_log" common
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://www.example.com/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "${apache-config:httpd-base}/cgi-bin/"
</IfModule>
<IfModule cgid_module>
#
# ScriptSock: On threaded servers, designate the path to the UNIX
# socket used to communicate with the CGI daemon of mod_cgid.
#
#Scriptsock cgisock
</IfModule>
#
# "/cygdrive/d/slapos/opt/wordpress/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "${apache-config:httpd-base}/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig conf/mime.types
# Php supports
AddType application/x-httpd-php .php
#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi
# For type maps (negotiated resources):
#AddHandler type-map var
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
</IfModule>
#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type. The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
#MIMEMagicFile conf/magic
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
#
# MaxRanges: Maximum number of Ranges in a request before
# returning the entire resource, or one of the special
# values 'default', 'none' or 'unlimited'.
# Default setting is to accept 200 Ranges.
#MaxRanges unlimited
#
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall may be used to deliver
# files. This usually improves server performance, but must
# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
# Defaults: EnableMMAP On, EnableSendfile Off
#
#EnableMMAP off
#EnableSendfile on
# Supplemental configuration
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server, or you may simply copy their contents here and change as
# necessary.
# Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf
# Multi-language error messages
#Include conf/extra/httpd-multilang-errordoc.conf
# Fancy directory listings
#Include conf/extra/httpd-autoindex.conf
# Language settings
#Include conf/extra/httpd-languages.conf
# User home directories
#Include conf/extra/httpd-userdir.conf
# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf
# Distributed authoring and versioning (WebDAV)
#Include conf/extra/httpd-dav.conf
# Various default settings
#Include conf/extra/httpd-default.conf
# Configure mod_proxy_html to understand HTML4/XHTML1
<IfModule proxy_html_module>
#Include conf/extra/proxy-html.conf
</IfModule>
# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf
# Provide a way for additional packages to add configuration fragments
#Include conf/conf.d/*.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
# Deal with user agents that deliberately violate open standards
#
<IfModule setenvif_module>
BrowserMatch "MSIE 10.0;" bad_DNT
</IfModule>
<IfModule headers_module>
RequestHeader unset DNT env=bad_DNT
</IfModule>
# Example MariaDB config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MariaDB plays
# an important part, or systems up to 128M where MariaDB is used together with
# other programs (such as a web server)
#
# MariaDB programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, do:
# 'my_print_defaults --help' and see what is printed under
# Default options are read from the following files in the given order:
# More information at: http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MariaDB clients
[client]
#password = your_password
port = ${mariadb-config:mysql-port}
socket = ${layout:tmp}/mysql.sock
# Here follows entries for some specific programs
# The MariaDB server
[mysqld]
port = ${mariadb-config:mysql-port}
socket = ${layout:tmp}/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
# Point the following paths to different dedicated disks
tmpdir = ${layout:tmp}/
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# binary logging format - mixed recommended
binlog_format=mixed
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1
# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = ${mariadb-config:mysql-datadir}
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = ${mariadb-config:mysql-datadir}
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
; 1. SAPI module specific location.
; 2. The PHPRC environment variable. (As of PHP 5.2.0)
; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0)
; 4. Current working directory (except CLI)
; 5. The web server's directory (for SAPI modules), or directory of PHP
; (otherwise in Windows)
; 6. The directory from the --with-config-file-path compile time option, or the
; Windows directory (C:\windows or C:\winnt)
; See the PHP docs for more specific information.
; http://php.net/configuration.file
; The syntax of the file is extremely simple. Whitespace and Lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.
; Directives following the section heading [PATH=/www/mysite] only
; apply to PHP files in the /www/mysite directory. Directives
; following the section heading [HOST=www.example.com] only apply to
; PHP files served from www.example.com. Directives set in these
; special sections cannot be overridden by user-defined INI files or
; at runtime. Currently, [PATH=] and [HOST=] sections only work under
; CGI/FastCGI.
; http://php.net/ini.sections
; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
; Directives are variables used to configure PHP or PHP extensions.
; There is no name validation. If PHP can't find an expected
; directive because it is not set or is mistyped, a default value will be used.
; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a
; previously set variable or directive (e.g. $${foo})
; Expressions in the INI file are limited to bitwise operators and parentheses:
; | bitwise OR
; ^ bitwise XOR
; & bitwise AND
; ~ bitwise NOT
; ! boolean NOT
; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.
; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:
; foo = ; sets foo to an empty string
; foo = None ; sets foo to an empty string
; foo = "None" ; sets foo to the string 'None'
; If you use constants in your value, and these constants belong to a
; dynamically loaded extension (either a PHP extension or a Zend extension),
; you may only use these constants *after* the line that loads the extension.
;;;;;;;;;;;;;;;;;;;
; About this file ;
;;;;;;;;;;;;;;;;;;;
; PHP comes packaged with two INI files. One that is recommended to be used
; in production environments and one that is recommended to be used in
; development environments.
; php.ini-production contains settings which hold security, performance and
; best practices at its core. But please be aware, these settings may break
; compatibility with older or less security conscience applications. We
; recommending using the production ini in production and testing environments.
; php.ini-development is very similar to its production variant, except it's
; much more verbose when it comes to errors. We recommending using the
; development version only in development environments as errors shown to
; application users can inadvertently leak otherwise secure information.
;;;;;;;;;;;;;;;;;;;
; Quick Reference ;
;;;;;;;;;;;;;;;;;;;
; The following are all the settings which are different in either the production
; or development versions of the INIs with respect to PHP's default behavior.
; Please see the actual settings later in the document for more details as to why
; we recommend these changes in PHP's behavior.
; allow_call_time_pass_reference
; Default Value: On
; Development Value: Off
; Production Value: Off
; display_errors
; Default Value: On
; Development Value: On
; Production Value: Off
; display_startup_errors
; Default Value: Off
; Development Value: On
; Production Value: Off
; error_reporting
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; html_errors
; Default Value: On
; Development Value: On
; Production value: Off
; log_errors
; Default Value: Off
; Development Value: On
; Production Value: On
; magic_quotes_gpc
; Default Value: On
; Development Value: Off
; Production Value: Off
; max_input_time
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; output_buffering
; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; register_argc_argv
; Default Value: On
; Development Value: Off
; Production Value: Off
; register_long_arrays
; Default Value: On
; Development Value: Off
; Production Value: Off
; request_order
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
; session.bug_compat_42
; Default Value: On
; Development Value: On
; Production Value: Off
; session.bug_compat_warn
; Default Value: On
; Development Value: On
; Production Value: Off
; session.gc_divisor
; Default Value: 100
; Development Value: 1000
; Production Value: 1000
; session.hash_bits_per_character
; Default Value: 4
; Development Value: 5
; Production Value: 5
; short_open_tag
; Default Value: On
; Development Value: Off
; Production Value: Off
; track_errors
; Default Value: Off
; Development Value: On
; Production Value: Off
; url_rewriter.tags
; Default Value: "a=href,area=href,frame=src,form=,fieldset="
; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; variables_order
; Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
;;;;;;;;;;;;;;;;;;;;
; php.ini Options ;
;;;;;;;;;;;;;;;;;;;;
; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
;user_ini.filename = ".user.ini"
; To disable this feature set this option to empty value
;user_ini.filename =
; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes)
;user_ini.cache_ttl = 300
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
; Enable the PHP scripting language engine under Apache.
; http://php.net/engine
engine = On
; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It's been
; recommended for several years that you not use the short tag "short cut" and
; instead to use the full <?php and ?> tag combination. With the wide spread use
; of XML and use of these tags by other languages, the server can become easily
; confused and end up parsing the wrong code in the wrong context. But because
; this short cut has been a feature for such a long time, it's currently still
; supported for backwards compatibility, but we recommend you don't use them.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = Off
; Allow ASP-style <% %> tags.
; http://php.net/asp-tags
asp_tags = Off
; The number of significant digits displayed in floating point numbers.
; http://php.net/precision
precision = 14
; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
; http://php.net/y2k-compliance
y2k_compliance = On
; Output buffering is a mechanism for controlling how much output data
; (excluding headers and cookies) PHP should keep internally before pushing that
; data to the client. If your application's output exceeds this setting, PHP
; will send that data in chunks of roughly the size you specify.
; Turning on this setting and managing its maximum buffer size can yield some
; interesting side-effects depending on your application and web server.
; You may be able to send headers and cookies after you've already sent output
; through print or echo. You also may see performance benefits if your server is
; emitting less packets due to buffered output versus PHP streaming the output
; as it gets it. On production servers, 4096 bytes is a good setting for performance
; reasons.
; Note: Output buffering can also be controlled via Output Buffering Control
; functions.
; Possible Values:
; On = Enabled and buffer is unlimited. (Use with caution)
; Off = Disabled
; Integer = Enables the buffer and sets its maximum size in bytes.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; http://php.net/output-buffering
output_buffering = 4096
; You can redirect all of the output of your scripts to a function. For
; example, if you set output_handler to "mb_output_handler", character
; encoding will be transparently converted to the specified encoding.
; Setting any output handler automatically turns on output buffering.
; Note: People who wrote portable scripts should not depend on this ini
; directive. Instead, explicitly set the output handler using ob_start().
; Using this ini directive may cause problems unless you know what script
; is doing.
; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
; and you cannot use both "ob_gzhandler" and "zlib.output_compression".
; Note: output_handler must be empty if this is set 'On' !!!!
; Instead you must use zlib.output_handler.
; http://php.net/output-handler
;output_handler =
; Transparent output compression using the zlib library
; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
; Note: Resulting chunk size may vary due to nature of compression. PHP
; outputs chunks that are few hundreds bytes each as a result of
; compression. If you prefer a larger chunk size for better
; performance, enable output_buffering in addition.
; Note: You need to use zlib.output_handler instead of the standard
; output_handler, or otherwise the output will be corrupted.
; http://php.net/zlib.output-compression
zlib.output_compression = Off
; http://php.net/zlib.output-compression-level
;zlib.output_compression_level = -1
; You cannot specify additional output handlers if zlib.output_compression
; is activated here. This setting does the same as output_handler but in
; a different order.
; http://php.net/zlib.output-handler
;zlib.output_handler =
; Implicit flush tells PHP to tell the output layer to flush itself
; automatically after every output block. This is equivalent to calling the
; PHP function flush() after each and every call to print() or echo() and each
; and every HTML block. Turning this option on has serious performance
; implications and is generally recommended for debugging purposes only.
; http://php.net/implicit-flush
; Note: This directive is hardcoded to On for the CLI SAPI
implicit_flush = Off
; The unserialize callback function will be called (with the undefined class'
; name as parameter), if the unserializer finds an undefined class
; which should be instantiated. A warning appears if the specified function is
; not defined, or if the function doesn't include/implement the missing class.
; So only set this entry, if you really want to implement such a
; callback-function.
unserialize_callback_func =
; When floats & doubles are serialized store serialize_precision significant
; digits after the floating point. The default value ensures that when floats
; are decoded with unserialize, the data will remain the same.
serialize_precision = 17
; This directive allows you to enable and disable warnings which PHP will issue
; if you pass a value by reference at function call time. Passing values by
; reference at function call time is a deprecated feature which will be removed
; from PHP at some point in the near future. The acceptable method for passing a
; value by reference to a function is by declaring the reference in the functions
; definition, not at call time. This directive does not disable this feature, it
; only determines whether PHP will warn you about it or not. These warnings
; should enabled in development environments only.
; Default Value: On (Suppress warnings)
; Development Value: Off (Issue warnings)
; Production Value: Off (Issue warnings)
; http://php.net/allow-call-time-pass-reference
allow_call_time_pass_reference = Off
; Safe Mode
; http://php.net/safe-mode
safe_mode = Off
; By default, Safe Mode does a UID compare check when
; opening files. If you want to relax this to a GID compare,
; then turn on safe_mode_gid.
; http://php.net/safe-mode-gid
safe_mode_gid = Off
; When safe_mode is on, UID/GID checks are bypassed when
; including files from this directory and its subdirectories.
; (directory must also be in include_path or full path must
; be used when including)
; http://php.net/safe-mode-include-dir
safe_mode_include_dir =
; When safe_mode is on, only executables located in the safe_mode_exec_dir
; will be allowed to be executed via the exec family of functions.
; http://php.net/safe-mode-exec-dir
safe_mode_exec_dir =
; Setting certain environment variables may be a potential security breach.
; This directive contains a comma-delimited list of prefixes. In Safe Mode,
; the user may only alter environment variables whose names begin with the
; prefixes supplied here. By default, users will only be able to set
; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
; Note: If this directive is empty, PHP will let the user modify ANY
; environment variable!
; http://php.net/safe-mode-allowed-env-vars
safe_mode_allowed_env_vars = PHP_
; This directive contains a comma-delimited list of environment variables that
; the end user won't be able to change using putenv(). These variables will be
; protected even if safe_mode_allowed_env_vars is set to allow to change them.
; http://php.net/safe-mode-protected-env-vars
safe_mode_protected_env_vars = LD_LIBRARY_PATH
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
; http://php.net/open-basedir
;open_basedir =
; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-functions
disable_functions =
; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
; http://php.net/disable-classes
disable_classes =
; Colors for Syntax Highlighting mode. Anything that's acceptable in
; <span style="color: ???????"> would work.
; http://php.net/syntax-highlighting
;highlight.string = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg = #FFFFFF
;highlight.default = #0000BB
;highlight.html = #000000
; If enabled, the request will be allowed to complete even if the user aborts
; the request. Consider enabling it if executing long requests, which may end up
; being interrupted by the user or a browser timing out. PHP's default behavior
; is to disable this feature.
; http://php.net/ignore-user-abort
;ignore_user_abort = On
; Determines the size of the realpath cache to be used by PHP. This value should
; be increased on systems where PHP opens many files to reflect the quantity of
; the file operations performed.
; http://php.net/realpath-cache-size
;realpath_cache_size = 16k
; Duration of time, in seconds for which to cache realpath information for a given
; file or directory. For systems with rarely changing files, consider increasing this
; value.
; http://php.net/realpath-cache-ttl
;realpath_cache_ttl = 120
; Enables or disables the circular reference collector.
; http://php.net/zend.enable-gc
zend.enable_gc = On
;;;;;;;;;;;;;;;;;
; Miscellaneous ;
;;;;;;;;;;;;;;;;;
; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header). It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
; http://php.net/expose-php
expose_php = On
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 30
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 60
; Maximum input variable nesting level
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 64
; How many GET/POST/COOKIE input variables may be accepted
; max_input_vars = 1000
; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for. The recommended way of setting values for this
; directive is through the use of the error level constants and bitwise
; operators. The error level constants are below here for convenience as well as
; some common settings and their meanings.
; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
; those related to E_NOTICE and E_STRICT, which together cover best practices and
; recommended coding standards in PHP. For performance reasons, this is the
; recommend error reporting setting. Your production server shouldn't be wasting
; resources complaining about best practices and coding standards. That's what
; development servers and development settings are for.
; Note: The php.ini-development file has this setting as E_ALL | E_STRICT. This
; means it pretty much reports everything which is exactly what you want during
; development and early testing.
;
; Error Level Constants:
; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
; E_ERROR - fatal run-time errors
; E_RECOVERABLE_ERROR - almost fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to an
; empty string)
; E_STRICT - run-time notices, enable to have PHP suggest changes
; to your code which will ensure the best interoperability
; and forward compatibility of your code
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message
; E_DEPRECATED - warn about code that will not work in future versions
; of PHP
; E_USER_DEPRECATED - user-generated deprecation warnings
;
; Common Values:
; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.)
; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices)
; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_DEPRECATED
; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; It's recommended that errors be logged on production servers rather than
; having the errors sent to STDOUT.
; Possible Values:
; Off = Do not display any errors
; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
; On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = Off
; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. PHP's default behavior is to suppress those
; errors from clients. Turning the display of startup errors on can be useful in
; debugging configuration problems. But, it's strongly recommended that you
; leave this setting off on production servers.
; Default Value: Off
; Development Value: On
; Production Value: Off
; http://php.net/display-startup-errors
display_startup_errors = Off
; Besides displaying errors, PHP can also log errors to locations such as a
; server-specific log, STDERR, or a location specified by the error_log
; directive found below. While errors should not be displayed on productions
; servers they should still be monitored and logging is a great way to do that.
; Default Value: Off
; Development Value: On
; Production Value: On
; http://php.net/log-errors
log_errors = On
; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
; http://php.net/log-errors-max-len
log_errors_max_len = 1024
; Do not log repeated messages. Repeated errors must occur in same file on same
; line unless ignore_repeated_source is set true.
; http://php.net/ignore-repeated-errors
ignore_repeated_errors = Off
; Ignore source of message when ignoring repeated messages. When this setting
; is On you will not log errors with repeated messages from different files or
; source lines.
; http://php.net/ignore-repeated-source
ignore_repeated_source = Off
; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This has only effect in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
; http://php.net/report-memleaks
report_memleaks = On
; This setting is on by default.
;report_zend_debug = 0
; Store the last error/warning message in $php_errormsg (boolean). Setting this value
; to On can assist in debugging and is appropriate for development servers. It should
; however be disabled on production servers.
; Default Value: Off
; Development Value: On
; Production Value: Off
; http://php.net/track-errors
track_errors = Off
; Turn off normal error reporting and emit XML-RPC error XML
; http://php.net/xmlrpc-errors
;xmlrpc_errors = 0
; An XML-RPC faultCode
;xmlrpc_error_number = 0
; When PHP displays or logs an error, it has the capability of inserting html
; links to documentation related to that error. This directive controls whether
; those HTML links appear in error messages or not. For performance and security
; reasons, it's recommended you disable this on production servers.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: On
; Development Value: On
; Production value: Off
; http://php.net/html-errors
html_errors = Off
; If html_errors is set On PHP produces clickable error messages that direct
; to a page describing the error or function causing the error in detail.
; You can download a copy of the PHP manual from http://php.net/docs
; and change docref_root to the base URL of your local copy including the
; leading '/'. You must also specify the file extension being used including
; the dot. PHP's default behavior is to leave these settings empty.
; Note: Never use this feature for production boxes.
; http://php.net/docref-root
; Examples
;docref_root = "/phpmanual/"
; http://php.net/docref-ext
;docref_ext = .html
; String to output before an error message. PHP's default behavior is to leave
; this setting blank.
; http://php.net/error-prepend-string
; Example:
;error_prepend_string = "<span style='color: #ff0000'>"
; String to output after an error message. PHP's default behavior is to leave
; this setting blank.
; http://php.net/error-append-string
; Example:
;error_append_string = "</span>"
; Log errors to specified file. PHP's default behavior is to leave this value
; empty.
; http://php.net/error-log
; Example:
;error_log = php_errors.log
; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog
;windows.show_crt_warning
; Default value: 0
; Development value: 0
; Production value: 0
;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
; The separator used in PHP generated URLs to separate arguments.
; PHP's default setting is "&".
; http://php.net/arg-separator.output
; Example:
;arg_separator.output = "&amp;"
; List of separator(s) used by PHP to parse input URLs into variables.
; PHP's default setting is "&".
; NOTE: Every character in this directive is considered as separator!
; http://php.net/arg-separator.input
; Example:
;arg_separator.input = ";&"
; This directive determines which super global arrays are registered when PHP
; starts up. If the register_globals directive is enabled, it also determines
; what order variables are populated into the global space. G,P,C,E & S are
; abbreviations for the following respective super globals: GET, POST, COOKIE,
; ENV and SERVER. There is a performance penalty paid for the registration of
; these arrays and because ENV is not as commonly used as the others, ENV is
; is not recommended on productions servers. You can still get access to
; the environment variables through getenv() should you need to.
; Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS";
; http://php.net/variables-order
variables_order = "GPCS"
; This directive determines which super global data (G,P,C,E & S) should
; be registered into the super global array REQUEST. If so, it also determines
; the order in which that data is registered. The values for this directive are
; specified in the same manner as the variables_order directive, EXCEPT one.
; Leaving this value empty will cause PHP to use the value set in the
; variables_order directive. It does not mean it will leave the super globals
; array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
; http://php.net/request-order
request_order = "GP"
; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data.
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
; http://php.net/register-globals
register_globals = Off
; Determines whether the deprecated long $HTTP_*_VARS type predefined variables
; are registered by PHP or not. As they are deprecated, we obviously don't
; recommend you use them. They are on by default for compatibility reasons but
; they are not recommended on production servers.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/register-long-arrays
register_long_arrays = Off
; This directive determines whether PHP registers $argv & $argc each time it
; runs. $argv contains an array of all the arguments passed to PHP when a script
; is invoked. $argc contains an integer representing the number of arguments
; that were passed when the script was invoked. These arrays are extremely
; useful when running scripts from the command line. When this directive is
; enabled, registering these variables consumes CPU cycles and memory each time
; a script is executed. For performance reasons, this feature should be disabled
; on production servers.
; Note: This directive is hardcoded to On for the CLI SAPI
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/register-argc-argv
register_argc_argv = Off
; When enabled, the SERVER and ENV variables are created when they're first
; used (Just In Time) instead of when the script starts. If these variables
; are not used within a script, having this directive on will result in a
; performance gain. The PHP directives register_globals, register_long_arrays,
; and register_argc_argv must be disabled for this directive to have any affect.
; http://php.net/auto-globals-jit
auto_globals_jit = On
; Maximum size of POST data that PHP will accept.
; http://php.net/post-max-size
post_max_size = 8M
; Magic quotes are a preprocessing feature of PHP where PHP will attempt to
; escape any character sequences in GET, POST, COOKIE and ENV data which might
; otherwise corrupt data being placed in resources such as databases before
; making that data available to you. Because of character encoding issues and
; non-standard SQL implementations across many databases, it's not currently
; possible for this feature to be 100% accurate. PHP's default behavior is to
; enable the feature. We strongly recommend you use the escaping mechanisms
; designed specifically for the database your using instead of relying on this
; feature. Also note, this feature has been deprecated as of PHP 5.3.0 and is
; scheduled removed in PHP 5.4.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/magic-quotes-gpc
magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
; http://php.net/magic-quotes-runtime
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of \').
; http://php.net/magic-quotes-sybase
magic_quotes_sybase = Off
; Automatically add files before PHP document.
; http://php.net/auto-prepend-file
auto_prepend_file =
; Automatically add files after PHP document.
; http://php.net/auto-append-file
auto_append_file =
; By default, PHP will output a character encoding using
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
;
; PHP's built-in default is text/html
; http://php.net/default-mimetype
default_mimetype = "text/html"
; PHP's default character set is set to empty.
; http://php.net/default-charset
;default_charset = "iso-8859-1"
; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
; to disable this feature.
; http://php.net/always-populate-raw-post-data
;always_populate_raw_post_data = On
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
;
; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path
; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
; http://php.net/doc-root
doc_root =
; The directory under which PHP opens the script using /~username used only
; if nonempty.
; http://php.net/user-dir
user_dir =
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
; extension_dir = "ext"
; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = Off
; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers. Left undefined, PHP turns this on by default. You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; http://php.net/cgi.force-redirect
;cgi.force_redirect = 1
; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
; every request. PHP's default behavior is to disable this feature.
;cgi.nph = 1
; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
; will look for to know it is OK to continue execution. Setting this variable MAY
; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
; http://php.net/cgi.redirect-status-env
;cgi.redirect_status_env = ;
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting
; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://php.net/cgi.fix-pathinfo
;cgi.fix_pathinfo=1
; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
; security tokens of the calling client. This allows IIS to define the
; security context that the request runs under. mod_fastcgi under Apache
; does not currently support this feature (03/17/2002)
; Set to 1 if running under IIS. Default is zero.
; http://php.net/fastcgi.impersonate
;fastcgi.impersonate = 1;
; Disable logging through FastCGI connection. PHP's default behavior is to enable
; this feature.
;fastcgi.logging = 0
; cgi.rfc2616_headers configuration option tells PHP what type of headers to
; use when sending HTTP response code. If it's set 0 PHP sends Status: header that
; is supported by Apache. When this option is set to 1 PHP will send
; RFC2616 compliant header.
; Default is zero.
; http://php.net/cgi.rfc2616-headers
;cgi.rfc2616_headers = 0
;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;
; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-fopen
allow_url_fopen = On
; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-include
allow_url_include = Off
; Define the anonymous ftp password (your email address). PHP's default setting
; for this is empty.
; http://php.net/from
;from="john@doe.com"
; Define the User-Agent string. PHP's default setting for this is empty.
; http://php.net/user-agent
;user_agent="PHP"
; Default timeout for socket based streams (seconds)
; http://php.net/default-socket-timeout
default_socket_timeout = 60
; If your scripts have to deal with files from Macintosh systems,
; or you are running on a Mac and need to deal with files from
; unix or win32 systems, setting this flag will cause PHP to
; automatically detect the EOL character in those files so that
; fgets() and file() will work regardless of the source of the file.
; http://php.net/auto-detect-line-endings
;auto_detect_line_endings = Off
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; ... or with a path:
;
; extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
;
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =
; http://php.net/date.default-latitude
;date.default_latitude = 31.7667
; http://php.net/date.default-longitude
;date.default_longitude = 35.2333
; http://php.net/date.sunrise-zenith
;date.sunrise_zenith = 90.583333
; http://php.net/date.sunset-zenith
;date.sunset_zenith = 90.583333
[filter]
; http://php.net/filter.default
;filter.default = unsafe_raw
; http://php.net/filter.default-flags
;filter.default_flags =
[iconv]
;iconv.input_encoding = ISO-8859-1
;iconv.internal_encoding = ISO-8859-1
;iconv.output_encoding = ISO-8859-1
[intl]
;intl.default_locale =
; This directive allows you to produce PHP errors when some error
; happens within intl functions. The value is the level of the error produced.
; Default is 0, which does not produce any errors.
;intl.error_level = E_WARNING
[sqlite]
; http://php.net/sqlite.assoc-case
;sqlite.assoc_case = 0
[sqlite3]
;sqlite3.extension_dir =
[Pcre]
;PCRE library backtracking limit.
; http://php.net/pcre.backtrack-limit
;pcre.backtrack_limit=100000
;PCRE library recursion limit.
;Please note that if you set this value to a high number you may consume all
;the available process stack and eventually crash PHP (due to reaching the
;stack size limit imposed by the Operating System).
; http://php.net/pcre.recursion-limit
;pcre.recursion_limit=100000
[Pdo]
; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
; http://php.net/pdo-odbc.connection-pooling
;pdo_odbc.connection_pooling=strict
;pdo_odbc.db2_instance_name
[Pdo_mysql]
; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/pdo_mysql.cache_size
pdo_mysql.cache_size = 2000
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
; http://php.net/pdo_mysql.default-socket
pdo_mysql.default_socket=
[Phar]
; http://php.net/phar.readonly
;phar.readonly = On
; http://php.net/phar.require-hash
;phar.require_hash = On
;phar.cache_list =
[Syslog]
; Whether or not to define the various syslog variables (e.g. $LOG_PID,
; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In
; runtime, you can define these variables by calling define_syslog_variables().
; http://php.net/define-syslog-variables
define_syslog_variables = Off
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On
; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
[SQL]
; http://php.net/sql.safe-mode
sql.safe_mode = Off
[ODBC]
; http://php.net/odbc.default-db
;odbc.default_db = Not yet implemented
; http://php.net/odbc.default-user
;odbc.default_user = Not yet implemented
; http://php.net/odbc.default-pw
;odbc.default_pw = Not yet implemented
; Controls the ODBC cursor model.
; Default: SQL_CURSOR_STATIC (default).
;odbc.default_cursortype
; Allow or prevent persistent links.
; http://php.net/odbc.allow-persistent
odbc.allow_persistent = On
; Check that a connection is still valid before reuse.
; http://php.net/odbc.check-persistent
odbc.check_persistent = On
; Maximum number of persistent links. -1 means no limit.
; http://php.net/odbc.max-persistent
odbc.max_persistent = -1
; Maximum number of links (persistent + non-persistent). -1 means no limit.
; http://php.net/odbc.max-links
odbc.max_links = -1
; Handling of LONG fields. Returns number of bytes to variables. 0 means
; passthru.
; http://php.net/odbc.defaultlrl
odbc.defaultlrl = 4096
; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char.
; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
; of odbc.defaultlrl and odbc.defaultbinmode
; http://php.net/odbc.defaultbinmode
odbc.defaultbinmode = 1
;birdstep.max_links = -1
[Interbase]
; Allow or prevent persistent links.
ibase.allow_persistent = 1
; Maximum number of persistent links. -1 means no limit.
ibase.max_persistent = -1
; Maximum number of links (persistent + non-persistent). -1 means no limit.
ibase.max_links = -1
; Default database name for ibase_connect().
;ibase.default_db =
; Default username for ibase_connect().
;ibase.default_user =
; Default password for ibase_connect().
;ibase.default_password =
; Default charset for ibase_connect().
;ibase.default_charset =
; Default timestamp format.
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
; Default date format.
ibase.dateformat = "%Y-%m-%d"
; Default time format.
ibase.timeformat = "%H:%M:%S"
[MySQL]
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
; http://php.net/mysql.allow_local_infile
mysql.allow_local_infile = On
; Allow or prevent persistent links.
; http://php.net/mysql.allow-persistent
mysql.allow_persistent = On
; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/mysql.cache_size
mysql.cache_size = 2000
; Maximum number of persistent links. -1 means no limit.
; http://php.net/mysql.max-persistent
mysql.max_persistent = -1
; Maximum number of links (persistent + non-persistent). -1 means no limit.
; http://php.net/mysql.max-links
mysql.max_links = -1
; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
; http://php.net/mysql.default-port
mysql.default_port = ${mariadb-config:mysql-port}
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
; http://php.net/mysql.default-socket
mysql.default_socket = ${layout:directory}/tmp/mysql.sock
; Default host for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysql.default-host
mysql.default_host =
; Default user for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysql.default-user
mysql.default_user =
; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
; http://php.net/mysql.default-password
mysql.default_password =
; Maximum time (in seconds) for connect timeout. -1 means no limit
; http://php.net/mysql.connect-timeout
mysql.connect_timeout = 60
; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
; http://php.net/mysql.trace-mode
mysql.trace_mode = Off
[MySQLi]
; Maximum number of persistent links. -1 means no limit.
; http://php.net/mysqli.max-persistent
mysqli.max_persistent = -1
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
; http://php.net/mysqli.allow_local_infile
;mysqli.allow_local_infile = On
; Allow or prevent persistent links.
; http://php.net/mysqli.allow-persistent
mysqli.allow_persistent = On
; Maximum number of links. -1 means no limit.
; http://php.net/mysqli.max-links
mysqli.max_links = -1
; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/mysqli.cache_size
mysqli.cache_size = 2000
; Default port number for mysqli_connect(). If unset, mysqli_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
; http://php.net/mysqli.default-port
mysqli.default_port = ${mariadb-config:mysql-port}
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
; http://php.net/mysqli.default-socket
mysqli.default_socket = ${layout:directory}/tmp/mysql.sock
; Default host for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysqli.default-host
mysqli.default_host =
; Default user for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysqli.default-user
mysqli.default_user =
; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
; http://php.net/mysqli.default-pw
mysqli.default_pw =
; Allow or prevent reconnect
mysqli.reconnect = Off
[mysqlnd]
; Enable / Disable collection of general statistics by mysqlnd which can be
; used to tune and monitor MySQL operations.
; http://php.net/mysqlnd.collect_statistics
mysqlnd.collect_statistics = On
; Enable / Disable collection of memory usage statistics by mysqlnd which can be
; used to tune and monitor MySQL operations.
; http://php.net/mysqlnd.collect_memory_statistics
mysqlnd.collect_memory_statistics = Off
; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
; http://php.net/mysqlnd.net_cmd_buffer_size
;mysqlnd.net_cmd_buffer_size = 2048
; Size of a pre-allocated buffer used for reading data sent by the server in
; bytes.
; http://php.net/mysqlnd.net_read_buffer_size
;mysqlnd.net_read_buffer_size = 32768
[OCI8]
; Connection: Enables privileged connections using external
; credentials (OCI_SYSOPER, OCI_SYSDBA)
; http://php.net/oci8.privileged-connect
;oci8.privileged_connect = Off
; Connection: The maximum number of persistent OCI8 connections per
; process. Using -1 means no limit.
; http://php.net/oci8.max-persistent
;oci8.max_persistent = -1
; Connection: The maximum number of seconds a process is allowed to
; maintain an idle persistent connection. Using -1 means idle
; persistent connections will be maintained forever.
; http://php.net/oci8.persistent-timeout
;oci8.persistent_timeout = -1
; Connection: The number of seconds that must pass before issuing a
; ping during oci_pconnect() to check the connection validity. When
; set to 0, each oci_pconnect() will cause a ping. Using -1 disables
; pings completely.
; http://php.net/oci8.ping-interval
;oci8.ping_interval = 60
; Connection: Set this to a user chosen connection class to be used
; for all pooled server requests with Oracle 11g Database Resident
; Connection Pooling (DRCP). To use DRCP, this value should be set to
; the same string for all web servers running the same application,
; the database pool must be configured, and the connection string must
; specify to use a pooled server.
;oci8.connection_class =
; High Availability: Using On lets PHP receive Fast Application
; Notification (FAN) events generated when a database node fails. The
; database must also be configured to post FAN events.
;oci8.events = Off
; Tuning: This option enables statement caching, and specifies how
; many statements to cache. Using 0 disables statement caching.
; http://php.net/oci8.statement-cache-size
;oci8.statement_cache_size = 20
; Tuning: Enables statement prefetching and sets the default number of
; rows that will be fetched automatically after statement execution.
; http://php.net/oci8.default-prefetch
;oci8.default_prefetch = 100
; Compatibility. Using On means oci_close() will not close
; oci_connect() and oci_new_connect() connections.
; http://php.net/oci8.old-oci-close-semantics
;oci8.old_oci_close_semantics = Off
[PostgreSQL]
; Allow or prevent persistent links.
; http://php.net/pgsql.allow-persistent
pgsql.allow_persistent = On
; Detect broken persistent links always with pg_pconnect().
; Auto reset feature requires a little overheads.
; http://php.net/pgsql.auto-reset-persistent
pgsql.auto_reset_persistent = Off
; Maximum number of persistent links. -1 means no limit.
; http://php.net/pgsql.max-persistent
pgsql.max_persistent = -1
; Maximum number of links (persistent+non persistent). -1 means no limit.
; http://php.net/pgsql.max-links
pgsql.max_links = -1
; Ignore PostgreSQL backends Notice message or not.
; Notice message logging require a little overheads.
; http://php.net/pgsql.ignore-notice
pgsql.ignore_notice = 0
; Log PostgreSQL backends Notice message or not.
; Unless pgsql.ignore_notice=0, module cannot log notice message.
; http://php.net/pgsql.log-notice
pgsql.log_notice = 0
[Sybase-CT]
; Allow or prevent persistent links.
; http://php.net/sybct.allow-persistent
sybct.allow_persistent = On
; Maximum number of persistent links. -1 means no limit.
; http://php.net/sybct.max-persistent
sybct.max_persistent = -1
; Maximum number of links (persistent + non-persistent). -1 means no limit.
; http://php.net/sybct.max-links
sybct.max_links = -1
; Minimum server message severity to display.
; http://php.net/sybct.min-server-severity
sybct.min_server_severity = 10
; Minimum client message severity to display.
; http://php.net/sybct.min-client-severity
sybct.min_client_severity = 10
; Set per-context timeout
; http://php.net/sybct.timeout
;sybct.timeout=
;sybct.packet_size
; The maximum time in seconds to wait for a connection attempt to succeed before returning failure.
; Default: one minute
;sybct.login_timeout=
; The name of the host you claim to be connecting from, for display by sp_who.
; Default: none
;sybct.hostname=
; Allows you to define how often deadlocks are to be retried. -1 means "forever".
; Default: 0
;sybct.deadlock_retry_count=
[bcmath]
; Number of decimal digits for all bcmath functions.
; http://php.net/bcmath.scale
bcmath.scale = 0
[browscap]
; http://php.net/browscap
;browscap = extra/browscap.ini
[Session]
; Handler used to store/retrieve data.
; http://php.net/session.save-handler
session.save_handler = files
; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
;
; The path can be defined as:
;
; session.save_path = "N;/path"
;
; where N is an integer. Instead of storing all the session files in
; /path, what this will do is use subdirectories N-levels deep, and
; store the session data in those directories. This is useful if you
; or your OS have problems with lots of files in one directory, and is
; a more efficient layout for servers that handle lots of sessions.
;
; NOTE 1: PHP will not create this directory structure automatically.
; You can use the script in the ext/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
; use subdirectories for session storage
;
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
; session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
; http://php.net/session.save-path
;session.save_path = "/tmp"
; Whether to use cookies.
; http://php.net/session.use-cookies
session.use_cookies = 1
; http://php.net/session.cookie-secure
;session.cookie_secure =
; This option forces PHP to fetch and use a cookie for storing and maintaining
; the session id. We encourage this operation as it's very helpful in combating
; session hijacking when not specifying and managing your own session id. It is
; not the end all be all of session hijacking defense, but it's a good start.
; http://php.net/session.use-only-cookies
session.use_only_cookies = 1
; Name of the session (used as cookie name).
; http://php.net/session.name
session.name = PHPSESSID
; Initialize session on request startup.
; http://php.net/session.auto-start
session.auto_start = 0
; Lifetime in seconds of cookie or, if 0, until browser is restarted.
; http://php.net/session.cookie-lifetime
session.cookie_lifetime = 0
; The path for which the cookie is valid.
; http://php.net/session.cookie-path
session.cookie_path = /
; The domain for which the cookie is valid.
; http://php.net/session.cookie-domain
session.cookie_domain =
; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
; http://php.net/session.cookie-httponly
session.cookie_httponly =
; Handler used to serialize data. php is the standard serializer of PHP.
; http://php.net/session.serialize-handler
session.serialize_handler = php
; Defines the probability that the 'garbage collection' process is started
; on every session initialization. The probability is calculated by using
; gc_probability/gc_divisor. Where session.gc_probability is the numerator
; and gc_divisor is the denominator in the equation. Setting this value to 1
; when the session.gc_divisor value is 100 will give you approximately a 1% chance
; the gc will run on any give request.
; Default Value: 1
; Development Value: 1
; Production Value: 1
; http://php.net/session.gc-probability
session.gc_probability = 1
; Defines the probability that the 'garbage collection' process is started on every
; session initialization. The probability is calculated by using the following equation:
; gc_probability/gc_divisor. Where session.gc_probability is the numerator and
; session.gc_divisor is the denominator in the equation. Setting this value to 1
; when the session.gc_divisor value is 100 will give you approximately a 1% chance
; the gc will run on any give request. Increasing this value to 1000 will give you
; a 0.1% chance the gc will run on any give request. For high volume production servers,
; this is a more efficient approach.
; Default Value: 100
; Development Value: 1000
; Production Value: 1000
; http://php.net/session.gc-divisor
session.gc_divisor = 1000
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; http://php.net/session.gc-maxlifetime
session.gc_maxlifetime = 1440
; NOTE: If you are using the subdirectory option for storing session files
; (see session.save_path above), then garbage collection does *not*
; happen automatically. You will need to do your own garbage
; collection through a shell script, cron entry, or some other method.
; For example, the following script would is the equivalent of
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; find /path/to/sessions -cmin +24 | xargs rm
; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope, even when register_globals
; is disabled. PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning separately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled. This feature
; introduces some serious security problems if not handled correctly. It's
; recommended that you do not use this feature on production servers. But you
; should enable this on development servers and enable the warning as well. If you
; do not enable the feature on development servers, you won't be warned when it's
; used and debugging errors caused by this can be difficult to track down.
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/session.bug-compat-42
session.bug_compat_42 = Off
; This setting controls whether or not you are warned by PHP when initializing a
; session value into the global space. session.bug_compat_42 must be enabled before
; these warnings can be issued by PHP. See the directive above for more information.
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/session.bug-compat-warn
session.bug_compat_warn = Off
; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
; http://php.net/session.referer-check
session.referer_check =
; How many bytes to read from the file.
; http://php.net/session.entropy-length
session.entropy_length = 0
; Specified here to create the session id.
; http://php.net/session.entropy-file
; On systems that don't have /dev/urandom /dev/arandom can be used
; On windows, setting the entropy_length setting will activate the
; Windows random source (using the CryptoAPI)
;session.entropy_file = /dev/urandom
; Set to {nocache,private,public,} to determine HTTP caching aspects
; or leave this empty to avoid sending anti-caching headers.
; http://php.net/session.cache-limiter
session.cache_limiter = nocache
; Document expires after n minutes.
; http://php.net/session.cache-expire
session.cache_expire = 180
; trans sid support is disabled by default.
; Use of trans sid may risk your users security.
; Use this option with caution.
; - User may send URL contains active session ID
; to other person via. email/irc/etc.
; - URL that contains active session ID may be stored
; in publicly accessible computer.
; - User may access your site with the same session ID
; always using URL stored in browser's history or bookmarks.
; http://php.net/session.use-trans-sid
session.use_trans_sid = 0
; Select a hash function for use in generating session ids.
; Possible Values
; 0 (MD5 128 bits)
; 1 (SHA-1 160 bits)
; This option may also be set to the name of any hash function supported by
; the hash extension. A list of available hashes is returned by the hash_algos()
; function.
; http://php.net/session.hash-function
session.hash_function = 0
; Define how many bits are stored in each character when converting
; the binary hash data to something readable.
; Possible values:
; 4 (4 bits: 0-9, a-f)
; 5 (5 bits: 0-9, a-v)
; 6 (6 bits: 0-9, a-z, A-Z, "-", ",")
; Default Value: 4
; Development Value: 5
; Production Value: 5
; http://php.net/session.hash-bits-per-character
session.hash_bits_per_character = 5
; The URL rewriter will look for URLs in a defined set of HTML tags.
; form/fieldset are special; if you include them here, the rewriter will
; add a hidden <input> field with the info which is otherwise appended
; to URLs. If you want XHTML conformity, remove the form entry.
; Note that all valid entries require a "=", even if no value follows.
; Default Value: "a=href,area=href,frame=src,form=,fieldset="
; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; http://php.net/url-rewriter.tags
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
; Allow or prevent persistent links.
mssql.allow_persistent = On
; Maximum number of persistent links. -1 means no limit.
mssql.max_persistent = -1
; Maximum number of links (persistent+non persistent). -1 means no limit.
mssql.max_links = -1
; Minimum error severity to display.
mssql.min_error_severity = 10
; Minimum message severity to display.
mssql.min_message_severity = 10
; Compatibility mode with old versions of PHP 3.0.
mssql.compatability_mode = Off
; Connect timeout
;mssql.connect_timeout = 5
; Query timeout
;mssql.timeout = 60
; Valid range 0 - 2147483647. Default = 4096.
;mssql.textlimit = 4096
; Valid range 0 - 2147483647. Default = 4096.
;mssql.textsize = 4096
; Limits the number of records in each batch. 0 = all records in one batch.
;mssql.batchsize = 0
; Specify how datetime and datetim4 columns are returned
; On => Returns data converted to SQL server settings
; Off => Returns values as YYYY-MM-DD hh:mm:ss
;mssql.datetimeconvert = On
; Use NT authentication when connecting to the server
mssql.secure_connection = Off
; Specify max number of processes. -1 = library default
; msdlib defaults to 25
; FreeTDS defaults to 4096
;mssql.max_procs = -1
; Specify client character set.
; If empty or not set the client charset from freetds.conf is used
; This is only used when compiled with FreeTDS
;mssql.charset = "ISO-8859-1"
[Assertion]
; Assert(expr); active by default.
; http://php.net/assert.active
;assert.active = On
; Issue a PHP warning for each failed assertion.
; http://php.net/assert.warning
;assert.warning = On
; Don't bail out by default.
; http://php.net/assert.bail
;assert.bail = Off
; User-function to be called if an assertion fails.
; http://php.net/assert.callback
;assert.callback = 0
; Eval the expression with current error_reporting(). Set to true if you want
; error_reporting(0) around the eval().
; http://php.net/assert.quiet-eval
;assert.quiet_eval = 0
[COM]
; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
; http://php.net/com.typelib-file
;com.typelib_file =
; allow Distributed-COM calls
; http://php.net/com.allow-dcom
;com.allow_dcom = true
; autoregister constants of a components typlib on com_load()
; http://php.net/com.autoregister-typelib
;com.autoregister_typelib = true
; register constants casesensitive
; http://php.net/com.autoregister-casesensitive
;com.autoregister_casesensitive = false
; show warnings on duplicate constant registrations
; http://php.net/com.autoregister-verbose
;com.autoregister_verbose = true
; The default character set code-page to use when passing strings to and from COM objects.
; Default: system ANSI code page
;com.code_page=
[mbstring]
; language for internal character representation.
; http://php.net/mbstring.language
;mbstring.language = Japanese
; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
; http://php.net/mbstring.internal-encoding
;mbstring.internal_encoding = EUC-JP
; http input encoding.
; http://php.net/mbstring.http-input
;mbstring.http_input = auto
; http output encoding. mb_output_handler must be
; registered as output buffer to function
; http://php.net/mbstring.http-output
;mbstring.http_output = SJIS
; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
; portable libs/applications.
; http://php.net/mbstring.encoding-translation
;mbstring.encoding_translation = Off
; automatic encoding detection order.
; auto means
; http://php.net/mbstring.detect-order
;mbstring.detect_order = auto
; substitute_character used when character cannot be converted
; one from another
; http://php.net/mbstring.substitute-character
;mbstring.substitute_character = none;
; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
; http://php.net/mbstring.func-overload
;mbstring.func_overload = 0
; enable strict encoding detection.
;mbstring.strict_detection = Off
; This directive specifies the regex pattern of content types for which mb_output_handler()
; is activated.
; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
;mbstring.http_output_conv_mimetype=
; Allows to set script encoding. Only affects if PHP is compiled with --enable-zend-multibyte
; Default: ""
;mbstring.script_encoding=
[gd]
; Tell the jpeg decode to ignore warnings and try to create
; a gd image. The warning will then be displayed as notices
; disabled by default
; http://php.net/gd.jpeg-ignore-warning
;gd.jpeg_ignore_warning = 0
[exif]
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
; With mbstring support this will automatically be converted into the encoding
; given by corresponding encode setting. When empty mbstring.internal_encoding
; is used. For the decode settings you can distinguish between motorola and
; intel byte order. A decode setting cannot be empty.
; http://php.net/exif.encode-unicode
;exif.encode_unicode = ISO-8859-15
; http://php.net/exif.decode-unicode-motorola
;exif.decode_unicode_motorola = UCS-2BE
; http://php.net/exif.decode-unicode-intel
;exif.decode_unicode_intel = UCS-2LE
; http://php.net/exif.encode-jis
;exif.encode_jis =
; http://php.net/exif.decode-jis-motorola
;exif.decode_jis_motorola = JIS
; http://php.net/exif.decode-jis-intel
;exif.decode_jis_intel = JIS
[Tidy]
; The path to a default tidy configuration file to use when using tidy
; http://php.net/tidy.default-config
;tidy.default_config = /usr/local/lib/php/default.tcfg
; Should tidy clean and repair output automatically?
; WARNING: Do not use this option if you are generating non-html content
; such as dynamic images
; http://php.net/tidy.clean-output
tidy.clean_output = Off
[soap]
; Enables or disables WSDL caching feature.
; http://php.net/soap.wsdl-cache-enabled
soap.wsdl_cache_enabled=1
; Sets the directory name where SOAP extension will put cache files.
; http://php.net/soap.wsdl-cache-dir
soap.wsdl_cache_dir="/tmp"
; (time to live) Sets the number of second while cached file will be used
; instead of original one.
; http://php.net/soap.wsdl-cache-ttl
soap.wsdl_cache_ttl=86400
; Sets the size of the cache limit. (Max. number of WSDL files to cache)
soap.wsdl_cache_limit = 5
[sysvshm]
; A default size of the shared memory segment
;sysvshm.init_mem = 10000
[ldap]
; Sets the maximum number of open links or -1 for unlimited.
ldap.max_links = -1
[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open
; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.algorithms_dir=
; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.modes_dir=
[dba]
;dba.default_handler=
[xsl]
; Write operations from within XSLT are disabled by default.
; XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_NETWORK | XSL_SECPREF_WRITE_FILE = 44
; Set it to 0 to allow all operations
;xsl.security_prefs = 44
; Local Variables:
; tab-width: 4
; End:
[buildout]
extends =
../../stack/lamp/buildout.cfg
../../component/mariadb/buildout.cfg
../../component/apache/buildout.cfg
../../component/apache-php/buildout.cfg
[application]
parts =
apache-php
wordpress
template
configure-files
prefix = ${buildout:directory}
find-links =
http://www.nexedi.org/static/packages/source/slapos.buildout/
versions = versions
[versions]
zc.buildout = 1.6.0-dev-SlapOS-010
[wordpress]
recipe = slapos.recipe.cmmi
prefix = ${buildout:parts-directory}/${:_buildout_section_name_}
url = http://wordpress.org/wordpress-3.4.2.tar.gz
md5sum = dfc56cee27eec8fb79070f033ecd4b25
configure-command = true
make-binary = true
post-install = cp -a * ${:prefix}/
[application-template]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/wp-config.php.in
md5sum = 0d62b28125ca3c780db0b547199953f2
download-only = True
filename = template.in
[x86-cygwin-wordpress]
patch-options = -p1
patches = ${:_profile_base_location_}/wordpress-3.4.2-mysqli.patch
post-install =
${wordpress:post-install}
ls -1 -d ${buildout:directory}/bin/*.dll > /rebase.filelist
ls -1 -d ${apache:prefix}/modules/*.so >> /rebase.filelist
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/template.cfg.in
md5sum = 2dc4b12c8ebe270516f6d02032f93071
output = ${buildout:directory}/template.cfg
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[application-configuration]
location = wp-config.php
[configure-files]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/configure-files.tar.gz
md5sum = 46f39abe6c7245fe7b30805b68b0d937
[buildout]
parts =
instance
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
versions = versions
offline = true
[layout]
directory = $${buildout:directory}
etc = $${:directory}/etc
run = $${:directory}/etc/run
service = $${:directory}/etc/service
data = $${:directory}/etc/data
logs = $${:directory}/etc/logs
tmp = $${:directory}/tmp
[apache-config]
url = ${configure-files:location}/httpd.conf.in
md5sum = 681f06c59e7bea33c77388bdd9b5ae41
output = $${layout:etc}/httpd.conf
mode = 0644
httpd-base = ${apache:prefix}
httpd-conf = $${:output}
httpd-docs = $${layout:etc}/httpdocs
httpd-port = 8080
[php-config]
url = ${configure-files:location}/php.ini.in
output = $${layout:etc}/php.ini
md5sum = 4282aa1bc6c6ee5946a5b28e0c8ffc9b
mode = 0644
[mariadb-config]
url = ${configure-files:location}/my.cnf.in
output = $${layout:etc}/my.cnf
md5sum = b454574ddd51570520855107bfde2f22
mode = 0644
mysql-base = ${mariadb:prefix}
mysql-conf = $${:output}
mysql-datadir = $${layout:data}
mysql-database = wordpress
mysql-host = localhost
mysql-port = 3306
mysql-user = wordpress
mysql-password = wordpress
[application-config]
url = ${configure-files:location}/wp-config.php.in
md5sum = 18b0be76e4c81c7d83b03543a93c17a5
output = $${apache-config:httpd-docs}/wp-config.php
mode = 0644
[instance]
recipe = slapos.recipe.cmmi:my-php-application
configure-parts = apache-config php-config mariadb-config application-config
source = ${wordpress:location}
install-parts = step-2
[step-2]
url = http://localhost:$${apache-config:httpd-port}/wp-admin/install.php?step=2
weblog_title = Demo Wordpress in Windows SlapOS Node
user_name = admin
admin_password = admin
admin_password2 = admin
admin_email = admin@unknown.com
[versions]
zc.buildout = 1.6.0-dev-SlapOS-010
diff --git a/wp-includes/load.php b/wp-includes/load.php
index 7e02620..3672aff 100644
--- a/wp-includes/load.php
+++ b/wp-includes/load.php
@@ -109,8 +109,8 @@ function wp_check_php_mysql_versions() {
}
if ( ! extension_loaded( 'mysql' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
- wp_load_translations_early();
- die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
+ // wp_load_translations_early();
+ // die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
}
}
diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php
index f418745..d2c2cfb 100644
--- a/wp-includes/wp-db.php
+++ b/wp-includes/wp-db.php
@@ -433,7 +433,7 @@ class wpdb {
var $collate;
/**
- * Whether to use mysql_real_escape_string
+ * Whether to use mysqli_real_escape_string
*
* @since 2.8.0
* @access public
@@ -540,7 +540,7 @@ class wpdb {
*
* @since 3.1.0
*
- * @param resource $dbh The resource given by mysql_connect
+ * @param resource $dbh The resource given by mysqli_connect
* @param string $charset The character set (optional)
* @param string $collate The collation (optional)
*/
@@ -550,15 +550,10 @@ class wpdb {
if ( !isset($collate) )
$collate = $this->collate;
if ( $this->has_cap( 'collation', $dbh ) && !empty( $charset ) ) {
- if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset', $dbh ) ) {
- mysql_set_charset( $charset, $dbh );
- $this->real_escape = true;
- } else {
- $query = $this->prepare( 'SET NAMES %s', $charset );
- if ( ! empty( $collate ) )
- $query .= $this->prepare( ' COLLATE %s', $collate );
- mysql_query( $query, $dbh );
- }
+ $query = $this->prepare( 'SET NAMES %s', $charset );
+ if ( ! empty( $collate ) )
+ $query .= $this->prepare( ' COLLATE %s', $collate );
+ mysqli_query( $dbh, $query );
}
}
@@ -774,9 +769,9 @@ class wpdb {
}
/**
- * Real escape, using mysql_real_escape_string() or addslashes()
+ * Real escape, using mysqli_real_escape_string() or addslashes()
*
- * @see mysql_real_escape_string()
+ * @see mysqli_real_escape_string()
* @see addslashes()
* @since 2.8.0
* @access private
@@ -786,7 +781,7 @@ class wpdb {
*/
function _real_escape( $string ) {
if ( $this->dbh && $this->real_escape )
- return mysql_real_escape_string( $string, $this->dbh );
+ return mysqli_real_escape_string( $this->dbh, $string );
else
return addslashes( $string );
}
@@ -919,7 +914,7 @@ class wpdb {
global $EZSQL_ERROR;
if ( !$str )
- $str = mysql_error( $this->dbh );
+ $str = mysqli_error( $this->dbh );
$EZSQL_ERROR[] = array( 'query' => $this->last_query, 'error_str' => $str );
if ( $this->suppress_errors )
@@ -1035,9 +1030,9 @@ class wpdb {
$this->is_mysql = true;
if ( WP_DEBUG ) {
- $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
+ $this->dbh = mysqli_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname);
} else {
- $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true );
+ $this->dbh = @mysqli_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname);
}
if ( !$this->dbh ) {
@@ -1059,8 +1054,6 @@ class wpdb {
$this->set_charset( $this->dbh );
$this->ready = true;
-
- $this->select( $this->dbname, $this->dbh );
}
/**
@@ -1092,14 +1085,14 @@ class wpdb {
if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )
$this->timer_start();
- $this->result = @mysql_query( $query, $this->dbh );
+ $this->result = @mysqli_query( $this->dbh, $query );
$this->num_queries++;
if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )
$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
// If there is an error then take note of it..
- if ( $this->last_error = mysql_error( $this->dbh ) ) {
+ if ( $this->last_error = mysqli_error( $this->dbh ) ) {
$this->print_error();
return false;
}
@@ -1107,26 +1100,26 @@ class wpdb {
if ( preg_match( '/^\s*(create|alter|truncate|drop) /i', $query ) ) {
$return_val = $this->result;
} elseif ( preg_match( '/^\s*(insert|delete|update|replace) /i', $query ) ) {
- $this->rows_affected = mysql_affected_rows( $this->dbh );
+ $this->rows_affected = mysqli_affected_rows( $this->dbh );
// Take note of the insert_id
if ( preg_match( '/^\s*(insert|replace) /i', $query ) ) {
- $this->insert_id = mysql_insert_id($this->dbh);
+ $this->insert_id = mysqli_insert_id($this->dbh);
}
// Return number of rows affected
$return_val = $this->rows_affected;
} else {
$i = 0;
- while ( $i < @mysql_num_fields( $this->result ) ) {
- $this->col_info[$i] = @mysql_fetch_field( $this->result );
+ while ( $i < @mysqli_num_fields( $this->result ) ) {
+ $this->col_info[$i] = @mysqli_fetch_field( $this->result );
$i++;
}
$num_rows = 0;
- while ( $row = @mysql_fetch_object( $this->result ) ) {
+ while ( $row = @mysqli_fetch_object( $this->result ) ) {
$this->last_result[$num_rows] = $row;
$num_rows++;
}
- @mysql_free_result( $this->result );
+ @mysqli_free_result( $this->result );
// Log number of rows the query returned
// and return number of rows selected
@@ -1537,8 +1530,8 @@ class wpdb {
function check_database_version() {
global $wp_version, $required_mysql_version;
// Make sure the server has the required MySQL version
- if ( version_compare($this->db_version(), $required_mysql_version, '<') )
- return new WP_Error('database_version', sprintf( __( '<strong>ERROR</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ));
+ //if ( version_compare($this->db_version(), $required_mysql_version, '<') )
+ // return new WP_Error('database_version', sprintf( __( '<strong>ERROR</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ));
}
/**
@@ -1600,6 +1593,6 @@ class wpdb {
* @return false|string false on failure, version number on success
*/
function db_version() {
- return preg_replace( '/[^0-9.].*/', '', mysql_get_server_info( $this->dbh ) );
+ return preg_replace( '/[^0-9.].*/', '', mysqli_get_server_info( $this->dbh ) );
}
}
......@@ -16,16 +16,16 @@
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', '%(mysql_database)s');
define('DB_NAME', '${mariadb-config:mysql-database}');
/** MySQL database username */
define('DB_USER', '%(mysql_user)s');
define('DB_USER', '${mariadb-config:mysql-user}');
/** MySQL database password */
define('DB_PASSWORD', '%(mysql_password)s');
define('DB_PASSWORD', '${mariadb-config:mysql-password}');
/** MySQL hostname */
define('DB_HOST', '%(mysql_host)s');
define('DB_HOST', '${mariadb-config:mysql-host}');
/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');
......@@ -89,4 +89,4 @@ if ( !defined('ABSPATH') )
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
remove_action( 'template_redirect', 'redirect_canonical' );
\ No newline at end of file
remove_action( 'template_redirect', 'redirect_canonical' );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment