ub_conf_file="$withval"
fi;
+# escape backslashes in the path for the C preprocessor
+hdr_config="`echo $ub_conf_file | sed -e 's/\\\\/\\\\\\\\/g'`"
cat >>confdefs.h <<_ACEOF
-#define CONFIGFILE "$ub_conf_file"
+#define CONFIGFILE "$hdr_config"
_ACEOF
UNBOUND_RUN_DIR=`dirname "$ub_conf_file"`
fi;
+hdr_run="`echo $UNBOUND_RUN_DIR | sed -e 's/\\\\/\\\\\\\\/g'`"
cat >>confdefs.h <<_ACEOF
-#define RUN_DIR "$UNBOUND_RUN_DIR"
+#define RUN_DIR "$hdr_run"
_ACEOF
UNBOUND_CHROOT_DIR="$UNBOUND_RUN_DIR"
fi;
+hdr_chroot="`echo $UNBOUND_CHROOT_DIR | sed -e 's/\\\\/\\\\\\\\/g'`"
cat >>confdefs.h <<_ACEOF
-#define CHROOT_DIR "$UNBOUND_CHROOT_DIR"
+#define CHROOT_DIR "$hdr_chroot"
_ACEOF
UNBOUND_PIDFILE="$UNBOUND_RUN_DIR/unbound.pid"
fi;
+hdr_pid="`echo $UNBOUND_PIDFILE | sed -e 's/\\\\/\\\\\\\\/g'`"
cat >>confdefs.h <<_ACEOF
-#define PIDFILE "$UNBOUND_PIDFILE"
+#define PIDFILE "$hdr_pid"
_ACEOF
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 5464 "configure"' > conftest.$ac_ext
+ echo '#line 5469 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6720: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6725: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6724: \$? = $ac_status" >&5
+ echo "$as_me:6729: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7010: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7015: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7014: \$? = $ac_status" >&5
+ echo "$as_me:7019: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7114: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7119: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7118: \$? = $ac_status" >&5
+ echo "$as_me:7123: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9384 "configure"
+#line 9389 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9484 "configure"
+#line 9489 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11888: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11893: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11892: \$? = $ac_status" >&5
+ echo "$as_me:11897: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11992: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11997: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11996: \$? = $ac_status" >&5
+ echo "$as_me:12001: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13556: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13561: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13560: \$? = $ac_status" >&5
+ echo "$as_me:13565: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13660: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13665: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13664: \$? = $ac_status" >&5
+ echo "$as_me:13669: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15832: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15837: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15836: \$? = $ac_status" >&5
+ echo "$as_me:15841: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16122: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16127: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16126: \$? = $ac_status" >&5
+ echo "$as_me:16131: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16226: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16231: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16230: \$? = $ac_status" >&5
+ echo "$as_me:16235: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
[Pathname to the Unbound configuration file]),
[ub_conf_file="$withval"])
AC_SUBST(ub_conf_file)
-AC_DEFINE_UNQUOTED(CONFIGFILE, ["$ub_conf_file"], [Pathname to the Unbound configuration file])
+# escape backslashes in the path for the C preprocessor
+hdr_config="`echo $ub_conf_file | sed -e 's/\\\\/\\\\\\\\/g'`"
+AC_DEFINE_UNQUOTED(CONFIGFILE, ["$hdr_config"], [Pathname to the Unbound configuration file])
# Determine run, chroot directory and pidfile locations
AC_ARG_WITH(run-dir,
UNBOUND_RUN_DIR="$withval",
UNBOUND_RUN_DIR=`dirname "$ub_conf_file"`)
AC_SUBST(UNBOUND_RUN_DIR)
-AC_DEFINE_UNQUOTED(RUN_DIR, ["$UNBOUND_RUN_DIR"], [Directory to chdir to])
+hdr_run="`echo $UNBOUND_RUN_DIR | sed -e 's/\\\\/\\\\\\\\/g'`"
+AC_DEFINE_UNQUOTED(RUN_DIR, ["$hdr_run"], [Directory to chdir to])
AC_ARG_WITH(chroot-dir,
AC_HELP_STRING([--with-chroot-dir=path],
UNBOUND_CHROOT_DIR="$withval",
UNBOUND_CHROOT_DIR="$UNBOUND_RUN_DIR")
AC_SUBST(UNBOUND_CHROOT_DIR)
-AC_DEFINE_UNQUOTED(CHROOT_DIR, ["$UNBOUND_CHROOT_DIR"], [Directory to chroot to])
+hdr_chroot="`echo $UNBOUND_CHROOT_DIR | sed -e 's/\\\\/\\\\\\\\/g'`"
+AC_DEFINE_UNQUOTED(CHROOT_DIR, ["$hdr_chroot"], [Directory to chroot to])
AC_ARG_WITH(pidfile,
AC_HELP_STRING([--with-pidfile=filename],
UNBOUND_PIDFILE="$withval",
UNBOUND_PIDFILE="$UNBOUND_RUN_DIR/unbound.pid")
AC_SUBST(UNBOUND_PIDFILE)
-AC_DEFINE_UNQUOTED(PIDFILE, ["$UNBOUND_PIDFILE"], [default pidfile location])
+hdr_pid="`echo $UNBOUND_PIDFILE | sed -e 's/\\\\/\\\\\\\\/g'`"
+AC_DEFINE_UNQUOTED(PIDFILE, ["$hdr_pid"], [default pidfile location])
AC_ARG_WITH(username,
AC_HELP_STRING([--with-username=user],
# Utility functions.
usage () {
cat >&2 <<EOF
-Usage $0: [-w] [-h] [-s] [-d SVN_root] [-l ldns_path]
+Usage $0: [-h] [-s] [-d SVN_root] [-l ldns_path] [-w ...configure args...]
Generate a distribution tar file for NSD.
-h This usage information.
- -w Build windows snapshot binary zip.
-s Build a snapshot distribution file. The current date is
automatically appended to the current NSD version number.
-rc <nr> Build a release candidate, the given string will be added
-d SVN_root Retrieve the NSD source from the specified repository.
Detected from svn working copy if not specified.
-l ldnsdir Directory where ldns resides. Detected from Makefile.
+ -w ... Build windows snapshot binary zip. last args put to configure.
EOF
exit 1
}
;;
"-w")
DOWIN="yes"
+ shift
+ break
;;
"-l")
LDNSDIR="$2"
if [ "$DOWIN" = "yes" ]; then
version=`./configure --version | head -1 | awk '{ print $3 }'` || \
error_cleanup "Cannot determine version number."
+ if [ "$RC" != "no" ]; then
+ version2="${version}rc$RC"
+ replace_text "configure.ac" "AC_INIT(unbound, $version" "AC_INIT(unbound, $version2"
+ version="$version2"
+ info "Rebuilding configure script (autoconf) snapshot."
+ autoreconf || error_cleanup "Autoconf failed."
+ rm -r autom4te* || error_cleanup "Failed to remove autoconf cache directory."
+ fi
+
+ info "Creating windows dist unbound $version"
+ info "Calling configure"
+ echo './configure --enable-debug --enable-static-exe "--with-conf-file=C:\Program Files\Unbound\service.conf" "--with-run-dir=C:\Program Files\Unbound" '"$*"
+ ./configure --enable-debug --enable-static-exe \
+ "--with-conf-file=C:\Program Files\Unbound\service.conf" \
+ "--with-run-dir=C:\Program Files\Unbound" $* \
+ || error_cleanup "Could not configure"
+ info "Calling make"
+ make || error_cleanup "Could not make"
+ info "Make complete"
+
info "Unbound version: $version"
file="unbound-$version.zip"
rm -f $file
cp ../unbound-checkconf.exe unbound-checkconf.exe
cp ../LICENSE LICENSE
cp ../winrc/unbound-website.url unbound-website.url
- zip ../$file LICENSE unbound.exe unbound-host.exe unbound-control.exe unbound-checkconf.exe example.conf unbound-website.url
- rm -f example.conf
+ cp ../winrc/service.conf service.conf
+ zip ../$file LICENSE unbound.exe unbound-host.exe unbound-control.exe unbound-checkconf.exe example.conf service.conf unbound-website.url
info "Testing $file"
cd ..
rm -rf tmp.$$