+# compile with optimisation and without debugging by default, unless
+# --debug is given. We must decide this before testing the compiler.
+
+AC_ARG_ENABLE(debug,
+ [ --enable-debug including debugging symbols and features])
+
+AC_MSG_CHECKING([whether to include debugging symbols])
+if test x"$enable_debug" = x"yes"
+then
+ AC_MSG_RESULT(yes)
+ # leave CFLAGS alone; AC_PROG_CC will try to include -g if it can
+ AC_DEFINE(DEBUG, 1, [Define to turn on debugging code that may slow normal operation])
+ CFLAGS=${CFLAGS-"-g"}
+else
+ AC_MSG_RESULT(no)
+ CFLAGS=${CFLAGS-"-O"}
+fi
+
+CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
+
+# look for getconf early as this affects just about everything
+AC_CHECK_PROG(HAVE_GETCONF, getconf, "yes", "no")
+if test $HAVE_GETCONF = "yes"; then
+ CFLAGS=$CFLAGS" "`getconf LFS_CFLAGS 2> /dev/null`
+ LDFLAGS=$LDFLAGS" "`getconf LFS_LDFLAGS 2> /dev/null`
+fi
+
+AC_ARG_WITH(included-popt,
+ [ --with-included-popt use bundled popt library, not from system])
+
+AC_ARG_WITH(rsync-path,
+ [ --with-rsync-path=PATH set rsync path used on server to PATH (default: "rsync")],
+ [ RSYNC_PATH="$with_rsync_name" ],
+ [ RSYNC_PATH="rsync" ])
+RSYNC_PATH="\"$RSYNC_PATH\""
+AC_DEFINE_UNQUOTED(RSYNC_PATH, $RSYNC_PATH)
+