]> jfr.im git - irc/rizon/znc.git/commitdiff
Some tweaking and cleaning up to configure.in
authorpsychon <redacted>
Wed, 15 Oct 2008 18:36:08 +0000 (18:36 +0000)
committerpsychon <redacted>
Wed, 15 Oct 2008 18:36:08 +0000 (18:36 +0000)
- Make it clear to autoconf that we are C++ only. It now no longer checks for a
  C compiler which might save time on some boxes.
- Honour CPPFLAGS.
- Remove some unused vars from AC_SUBST.
- Add includes to CXXFLAGS instead of using $INCLUDES for this.
- Use autoconf macros instead of 'echo' for the 'checking for perl' message.
- Fix all warnings from 'autoconf -W all'.
- Use AC_CONFIG_SRCDIR for helping configure find the source dir.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1251 726aef4b-f618-498e-8847-2d620e286838

Makefile.in
configure
configure.in
modules/Makefile.in
znc-config.in

index c3a0ab6bf3b2c772b83038585bd1253f4a284f70..e8e5e3810427503702c7103371152d3f1ba13a8b 100644 (file)
@@ -8,9 +8,8 @@ libdir      := @libdir@
 sbindir     := @sbindir@
 localstatedir := @localstatedir@
 CXX      := @CXX@
-CXXFLAGS := @CXXFLAGS@
+CXXFLAGS := @CPPFLAGS@ @CXXFLAGS@
 LDFLAGS  := @LDFLAGS@
-INCLUDES := @INCLUDES@
 LIBS     := @LIBS@
 
 SRCS := ZNCString.cpp Csocket.cpp main.cpp znc.cpp User.cpp IRCSock.cpp Client.cpp DCCBounce.cpp \
@@ -50,9 +49,9 @@ distclean: clean
 
 %.o: %.cpp Makefile
        @mkdir -p .depend
-       $(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< -MMD -MF .depend/$<.dep
+       $(CXX) $(CXXFLAGS) -c -o $@ $< -MMD -MF .depend/$<.dep
 
-install: znc @MODTARGET@
+install: znc
        mkdir -p $(DESTDIR)$(bindir)
        mkdir -p $(DESTDIR)$(prefix)/include/znc
        install -m 0755 znc $(DESTDIR)$(bindir)
index ff5a800efe72f1db19646a38eb0dac82a02e20bb..5a43bca71227bf4ef4b6d47639834e0957c24ec9 100755 (executable)
--- a/configure
+++ b/configure
@@ -576,6 +576,7 @@ PACKAGE_VERSION='0.061'
 PACKAGE_STRING='znc 0.061'
 PACKAGE_BUGREPORT=''
 
+ac_unique_file="znc.cpp"
 ac_subst_vars='SHELL
 PATH_SEPARATOR
 PACKAGE_NAME
@@ -628,14 +629,8 @@ host
 host_cpu
 host_vendor
 host_os
-CC
-CFLAGS
-ac_ct_CC
 MODFLAGS
-INCLUDES
-MODULES
 MODTARGET
-VERSION
 NOSSL
 PERL
 SASL
@@ -652,9 +647,7 @@ CXXFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
-CCC
-CC
-CFLAGS'
+CCC'
 
 
 # Initialize some variables set by options.
@@ -1254,8 +1247,6 @@ Some influential environment variables:
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
-  CC          C compiler command
-  CFLAGS      C compiler flags
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1687,7 +1678,16 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-SAVED_CXXFLAGS="$CXXFLAGS"
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+# AC_PROG_CXX sets CXXFLAGS to "-O2 -g" if it is unset which we don't want
+CXXFLAGS="$CXXFLAGS "
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2289,11 +2289,11 @@ else
     CXXFLAGS=
   fi
 fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2410,9 +2410,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
-CXXFLAGS="$SAVED_CXXFLAGS"
-INCLUDES=""
-
 appendLib () {
        if test "$LIBS" != ""; then
                LIBS="$LIBS $*"
@@ -2421,14 +2418,6 @@ appendLib () {
        fi
 }
 
-appendInc () {
-       if test "$INCLUDES" != ""; then
-               INCLUDES="$INCLUDES $*"
-       else
-               INCLUDES=$*
-       fi
-}
-
 appendCXX () {
        if test "$CXXFLAGS" != ""; then
                CXXFLAGS="$CXXFLAGS $*"
@@ -2449,7 +2438,7 @@ appendCXX "-D_FORTIFY_SOURCE=2"
 
 case "${host_os}" in
        freebsd*)
-               appendInc -I/usr/local/include
+               appendCXX -I/usr/local/include
                appendLib -L/usr/local/lib -lcompat
                MODFLAGS="$MODFLAGS -L/usr/local/lib"
        ;;
@@ -2537,786 +2526,110 @@ if test "x$GXX" = "xyes"; then
        appendCXX -Wall -W -Wno-unused-parameter -Woverloaded-virtual -Wshadow
 fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
 
 
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+{ echo "$as_me:$LINENO: checking for getopt_long in -lgnugetopt" >&5
+echo $ECHO_N "checking for getopt_long in -lgnugetopt... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gnugetopt_getopt_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgnugetopt  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getopt_long ();
+int
+main ()
+{
+return getopt_long ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  ac_cv_lib_gnugetopt_getopt_long=yes
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_gnugetopt_getopt_long=no
 fi
 
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gnugetopt_getopt_long" >&5
+echo "${ECHO_T}$ac_cv_lib_gnugetopt_getopt_long" >&6; }
+if test $ac_cv_lib_gnugetopt_getopt_long = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGNUGETOPT 1
+_ACEOF
 
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+  LIBS="-lgnugetopt $LIBS"
 
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
 fi
 
 
-  fi
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
 
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
 
 
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then
+for ac_func in stat lstat chmod open
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
 
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-fi
-
-fi
-
-
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_cc_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       CFLAGS=""
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_c_werror_flag=$ac_save_c_werror_flag
-        CFLAGS="-g"
-        cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_cc_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_cc_c89=$ac_arg
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
-  xno)
-    { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-{ echo "$as_me:$LINENO: checking for getopt_long in -lgnugetopt" >&5
-echo $ECHO_N "checking for getopt_long in -lgnugetopt... $ECHO_C" >&6; }
-if test "${ac_cv_lib_gnugetopt_getopt_long+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgnugetopt  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getopt_long ();
-int
-main ()
-{
-return getopt_long ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_lib_gnugetopt_getopt_long=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_gnugetopt_getopt_long=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_gnugetopt_getopt_long" >&5
-echo "${ECHO_T}$ac_cv_lib_gnugetopt_getopt_long" >&6; }
-if test $ac_cv_lib_gnugetopt_getopt_long = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGNUGETOPT 1
-_ACEOF
-
-  LIBS="-lgnugetopt $LIBS"
-
-fi
-
-
-
-
-
-for ac_func in stat lstat chmod open
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
 
 #undef $ac_func
 
@@ -3356,7 +2669,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+        test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
@@ -3380,8 +2693,8 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
 _ACEOF
 
 else
-  { { echo "$as_me:$LINENO: error: Missing Required libc feature" >&5
-echo "$as_me: error: Missing Required libc feature" >&2;}
+  { { echo "$as_me:$LINENO: error: missing required libc feature" >&5
+echo "$as_me: error: missing required libc feature" >&2;}
    { (exit 1); exit 1; }; }
 fi
 done
@@ -3390,7 +2703,7 @@ done
 if test -z "$NOSSL"; then
        if test -n "$OPENSSL"; then
                appendLib -L${OPENSSL}/lib
-               appendInc -I${OPENSSL}/include
+               appendCXX -I${OPENSSL}/include
        fi
 
        # Don't reorder this!
@@ -3439,7 +2752,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+        test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
@@ -3465,10 +2778,8 @@ _ACEOF
   LIBS="-lcrypto $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: Could not find libcrypto. Try --disable-openssl or install the
-                              appropriate dependencies eg. libssl-dev." >&5
-echo "$as_me: error: Could not find libcrypto. Try --disable-openssl or install the
-                              appropriate dependencies eg. libssl-dev." >&2;}
+  { { echo "$as_me:$LINENO: error: could not find libcrypto. Try --disable-openssl or install the appropriate dependencies eg. libssl-dev." >&5
+echo "$as_me: error: could not find libcrypto. Try --disable-openssl or install the appropriate dependencies eg. libssl-dev." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -3516,7 +2827,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+        test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
@@ -3542,10 +2853,8 @@ _ACEOF
   LIBS="-lssl $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: Could not find libssl. Try --disable-openssl or install the
-                              appropriate dependencies eg. libssl-dev." >&5
-echo "$as_me: error: Could not find libssl. Try --disable-openssl or install the
-                              appropriate dependencies eg. libssl-dev." >&2;}
+  { { echo "$as_me:$LINENO: error: could not find libssl. Try --disable-openssl or install the appropriate dependencies eg. libssl-dev." >&5
+echo "$as_me: error: could not find libssl. Try --disable-openssl or install the appropriate dependencies eg. libssl-dev." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -3650,7 +2959,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+        test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
@@ -3714,7 +3023,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+        test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
@@ -3740,8 +3049,8 @@ fi
        appendLib "$SAVED_LIBS"
 
        if test $FOUND_DL = "no" ; then
-               { { echo "$as_me:$LINENO: error: Could not find dlopen. Try --disable-modules" >&5
-echo "$as_me: error: Could not find dlopen. Try --disable-modules" >&2;}
+               { { echo "$as_me:$LINENO: error: could not find dlopen. Try --disable-modules" >&5
+echo "$as_me: error: could not find dlopen. Try --disable-modules" >&2;}
    { (exit 1); exit 1; }; }
        fi
 
@@ -3761,10 +3070,12 @@ echo "$as_me: error: Could not find dlopen. Try --disable-modules" >&2;}
        appendCXX "-D_DATADIR_=\\\"${DATADIR}\\\""
 
        if test -z "$NOPERL"; then
-               echo -n "checking for perl... "
+               { echo "$as_me:$LINENO: checking for perl" >&5
+echo $ECHO_N "checking for perl... $ECHO_C" >&6; }
                PERL=`which perl`
                if test -n "$PERL"; then
-                       echo "$PERL"
+                       { echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6; }
                        { echo "$as_me:$LINENO: checking for perl_alloc in -lperl" >&5
 echo $ECHO_N "checking for perl_alloc in -lperl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_perl_perl_alloc+set}" = set; then
@@ -3808,7 +3119,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+        test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
@@ -3829,15 +3140,16 @@ echo "${ECHO_T}$ac_cv_lib_perl_perl_alloc" >&6; }
 if test $ac_cv_lib_perl_perl_alloc = yes; then
   unset NOPERL
 else
-  { { echo "$as_me:$LINENO: error: Could not find libperl. Try --disable-perl" >&5
-echo "$as_me: error: Could not find libperl. Try --disable-perl" >&2;}
+  { { echo "$as_me:$LINENO: error: could not find libperl. Try --disable-perl" >&5
+echo "$as_me: error: could not find libperl. Try --disable-perl" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
                else
-                       echo "no"
-                       { { echo "$as_me:$LINENO: error: Could not find perl binary. Try --disable-perl" >&5
-echo "$as_me: error: Could not find perl binary. Try --disable-perl" >&2;}
+                       { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+                       { { echo "$as_me:$LINENO: error: could not find perl binary. Try --disable-perl" >&5
+echo "$as_me: error: could not find perl binary. Try --disable-perl" >&2;}
    { (exit 1); exit 1; }; }
                fi
        fi
@@ -3886,7 +3198,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+        test -z "$ac_cxx_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest$ac_exeext &&
        $as_test_x conftest$ac_exeext; then
@@ -3907,15 +3219,14 @@ echo "${ECHO_T}$ac_cv_lib_sasl2_sasl_server_init" >&6; }
 if test $ac_cv_lib_sasl2_sasl_server_init = yes; then
   : Dont let autoconf add -lsasl2, Makefile handles that
 else
-  { { echo "$as_me:$LINENO: error: Could not find libsasl2. Try --disable-sasl." >&5
-echo "$as_me: error: Could not find libsasl2. Try --disable-sasl." >&2;}
+  { { echo "$as_me:$LINENO: error: could not find libsasl2. Try --disable-sasl." >&5
+echo "$as_me: error: could not find libsasl2. Try --disable-sasl." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
        fi
 fi
 
-VERSION=0.061
 #
 # Auto detect modules
 
@@ -3930,8 +3241,6 @@ VERSION=0.061
 
 
 
-
-
 ac_config_files="$ac_config_files Makefile"
 
 ac_config_files="$ac_config_files znc-config"
@@ -4628,14 +3937,8 @@ host!$host$ac_delim
 host_cpu!$host_cpu$ac_delim
 host_vendor!$host_vendor$ac_delim
 host_os!$host_os$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
 MODFLAGS!$MODFLAGS$ac_delim
-INCLUDES!$INCLUDES$ac_delim
-MODULES!$MODULES$ac_delim
 MODTARGET!$MODTARGET$ac_delim
-VERSION!$VERSION$ac_delim
 NOSSL!$NOSSL$ac_delim
 PERL!$PERL$ac_delim
 SASL!$SASL$ac_delim
@@ -4645,7 +3948,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 67; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 61; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -4974,7 +4277,7 @@ fi
 
 
 echo
-echo znc $VERSION configured
+echo znc 0.061 configured
 echo
 echo "debug:   $DEBUG"
 echo "ipv6:    $IPV6"
index 08cd877441c09ce3e84c779cbde048a15c899b9a..c16b2466d1a88b5046a6b4f68e1cbdaf33bbc02f 100644 (file)
@@ -1,12 +1,13 @@
 dnl Keep the version number in sync with main.h!
 AC_INIT([znc], [0.061])
-SAVED_CXXFLAGS="$CXXFLAGS"
+AC_CONFIG_SRCDIR([znc.cpp])
+AC_LANG([C++])
+
+# AC_PROG_CXX sets CXXFLAGS to "-O2 -g" if it is unset which we don't want
+CXXFLAGS="$CXXFLAGS "
 AC_PROG_CXX
 AC_CANONICAL_HOST
 
-CXXFLAGS="$SAVED_CXXFLAGS"
-INCLUDES=""
-
 appendLib () {
        if test "$LIBS" != ""; then
                LIBS="$LIBS $*"
@@ -15,14 +16,6 @@ appendLib () {
        fi
 }
 
-appendInc () {
-       if test "$INCLUDES" != ""; then
-               INCLUDES="$INCLUDES $*"
-       else
-               INCLUDES=$*
-       fi
-}
-
 appendCXX () {
        if test "$CXXFLAGS" != ""; then
                CXXFLAGS="$CXXFLAGS $*"
@@ -43,7 +36,7 @@ appendCXX "-D_FORTIFY_SOURCE=2"
 
 case "${host_os}" in
        freebsd*)
-               appendInc -I/usr/local/include
+               appendCXX -I/usr/local/include
                appendLib -L/usr/local/lib -lcompat
                MODFLAGS="$MODFLAGS -L/usr/local/lib"
        ;;
@@ -64,31 +57,31 @@ if test -z "$ISCYGWIN" ; then
 fi
 
 AC_ARG_WITH( [openssl],
-       AC_HELP_STRING([--with-openssl=DIR], [openssl's installation prefix]),
+       AS_HELP_STRING([--with-openssl=DIR], [openssl's installation prefix]),
        [OPENSSL=$withval],)
 AC_ARG_ENABLE( [debug],
-       AC_HELP_STRING([--enable-debug], [enable debuging]),
+       AS_HELP_STRING([--enable-debug], [enable debuging]),
        [DEBUG="$enableval"],
        [DEBUG="no"])
 AC_ARG_ENABLE( [ipv6],
-       AC_HELP_STRING([--enable-ipv6], [enable ipv6 support]),
+       AS_HELP_STRING([--enable-ipv6], [enable ipv6 support]),
        [IPV6="$enableval"],
        [IPV6="no"])
 AC_ARG_ENABLE( [modules],
-       AC_HELP_STRING([--disable-modules], [disable modules]),
+       AS_HELP_STRING([--disable-modules], [disable modules]),
        [MODULES="$enableval"],
        [MODULES="yes"])
 AC_ARG_ENABLE( [openssl],
-       AC_HELP_STRING([--disable-openssl], [disable openssl]),
+       AS_HELP_STRING([--disable-openssl], [disable openssl]),
        [if test "$enableval" = "no" ; then NOSSL=1; fi],)
 AC_ARG_ENABLE( [perl],
-       AC_HELP_STRING([--disable-perl], [disable perl]),
+       AS_HELP_STRING([--disable-perl], [disable perl]),
        [if test "$enableval" = "no" ; then NOPERL=1; fi],)
 AC_ARG_ENABLE( [sasl],
-       AC_HELP_STRING([--enable-sasl], [enable sasl]),
+       AS_HELP_STRING([--enable-sasl], [enable sasl]),
        [if test "$enableval" = "yes" ; then SASL=1; fi],)
 AC_ARG_ENABLE( [optimization],
-       AC_HELP_STRING([--disable-optimization], [Disable some compiler optimizations to
+       AS_HELP_STRING([--disable-optimization], [Disable some compiler optimizations to
                        decrease memory usage while compiling]),
        [OPTIMIZE="$enableval"],
        [OPTIMIZE="yes"])
@@ -112,22 +105,20 @@ if test "x$GXX" = "xyes"; then
 fi
 
 AC_CHECK_LIB( gnugetopt, getopt_long,)
-AC_CHECK_FUNCS( stat lstat chmod open, , AC_ERROR([Missing Required libc feature]))
+AC_CHECK_FUNCS( stat lstat chmod open, , AC_MSG_ERROR([missing required libc feature]))
 
 if test -z "$NOSSL"; then
        if test -n "$OPENSSL"; then
                appendLib -L${OPENSSL}/lib
-               appendInc -I${OPENSSL}/include
+               appendCXX -I${OPENSSL}/include
        fi
 
        # Don't reorder this!
        # On some arches libssl depends on libcrypto without linking to it :(
        AC_CHECK_LIB( crypto, BIO_new,,
-                    AC_ERROR([Could not find libcrypto. Try --disable-openssl or install the
-                              appropriate dependencies eg. libssl-dev.]), )
+               AC_MSG_ERROR([could not find libcrypto. Try --disable-openssl or install the appropriate dependencies eg. libssl-dev.]), )
        AC_CHECK_LIB( ssl, SSL_shutdown,,
-                    AC_ERROR([Could not find libssl. Try --disable-openssl or install the
-                              appropriate dependencies eg. libssl-dev.]), )
+               AC_MSG_ERROR([could not find libssl. Try --disable-openssl or install the appropriate dependencies eg. libssl-dev.]), )
 
        if test -z "$NOSSL"; then
                appendCXX -DHAVE_LIBSSL
@@ -139,14 +130,13 @@ if test -z "$prefix" || test $prefix = "NONE"; then
 fi
 
 AC_ARG_WITH( [module-prefix],
-       AC_HELP_STRING([--with-module-prefix],
-                      [module object code [[LIBDIR/znc]]]),
+       AS_HELP_STRING([--with-module-prefix], [module object code [[LIBDIR/znc]]]),
        [MODDIR=$withval],
        [MODDIR="${libdir}/znc"] )
 
 AC_ARG_WITH( [module-data-prefix],
-       AC_HELP_STRING([--with-module-data-prefix=DIR],
-                      [static module data (webadmin skins) [[DATADIR/znc]]]),
+       AS_HELP_STRING([--with-module-data-prefix=DIR],
+               [static module data (webadmin skins) [[DATADIR/znc]]]),
        [DATADIR=$withval],
        [DATADIR="${datadir}/znc"] )
 
@@ -165,7 +155,7 @@ if test "$MODULES" = "yes"; then
        appendLib "$SAVED_LIBS"
 
        if test $FOUND_DL = "no" ; then
-               AC_ERROR([Could not find dlopen. Try --disable-modules])
+               AC_MSG_ERROR([could not find dlopen. Try --disable-modules])
        fi
 
        appendCXX -D_MODULES
@@ -184,38 +174,35 @@ if test "$MODULES" = "yes"; then
        appendCXX "-D_DATADIR_=\\\"${DATADIR}\\\""
 
        if test -z "$NOPERL"; then
-               echo -n "checking for perl... "
+               AC_MSG_CHECKING([for perl])
                PERL=`which perl`
                if test -n "$PERL"; then
-                       echo "$PERL"
+                       AC_MSG_RESULT([$PERL])
                        AC_CHECK_LIB(perl, perl_alloc,unset NOPERL,
-                               AC_ERROR([Could not find libperl. Try --disable-perl]),
+                               AC_MSG_ERROR([could not find libperl. Try --disable-perl]),
                                [`$PERL -MExtUtils::Embed -e ccopts -e ldopts`])
                else
-                       echo "no"
-                       AC_ERROR([Could not find perl binary. Try --disable-perl])
+                       AC_MSG_RESULT([no])
+                       AC_MSG_ERROR([could not find perl binary. Try --disable-perl])
                fi
        fi
 
        if test -n "$SASL"; then
                AC_CHECK_LIB( sasl2, sasl_server_init,
                        [: Dont let autoconf add -lsasl2, Makefile handles that],
-                       AC_ERROR([Could not find libsasl2. Try --disable-sasl.]))
+                       AC_MSG_ERROR([could not find libsasl2. Try --disable-sasl.]))
        fi
 fi
 
-VERSION=AC_PACKAGE_VERSION
 #
 # Auto detect modules
 
 AC_SUBST([CXXFLAGS])
+AC_SUBST([CPPFLAGS])
 AC_SUBST([MODFLAGS])
 AC_SUBST([LDFLAGS])
-AC_SUBST([INCLUDES])
 AC_SUBST([LIBS])
-AC_SUBST([MODULES])
 AC_SUBST([MODTARGET])
-AC_SUBST([VERSION])
 AC_SUBST([NOSSL])
 AC_SUBST([PERL])
 AC_SUBST([SASL])
@@ -231,7 +218,7 @@ fi
 AC_OUTPUT
 
 echo
-echo znc $VERSION configured
+echo znc AC_PACKAGE_VERSION configured
 echo
 echo "debug:   $DEBUG"
 echo "ipv6:    $IPV6"
index 18c6210acb58d3f10bc8eb119f4cf0d68e6418f6..d15b0207d530fee9897052103a3fbff261e459a0 100644 (file)
@@ -9,9 +9,8 @@ sbindir     := @sbindir@
 localstatedir := @localstatedir@
 CXX      := @CXX@
 # CXXFLAGS are for the main binary, so don't use them here, use MODFLAGS instead
-MODFLAGS := @MODFLAGS@
+MODFLAGS := @CPPFLAGS@ @MODFLAGS@ -I..
 LDFLAGS  := @LDFLAGS@
-INCLUDES := @INCLUDES@ -I..
 # LIBS are not and should not be used in here.
 # The znc binary links already against those.
 # LIBS     := @LIBS@
@@ -41,7 +40,6 @@ FILES    := $(shell echo $(FILES) | sed -e "s/saslauth//")
 endif
 saslauthFLAGS := -lsasl2
 
-SRCS     := $(wildcard ../*.cpp) $(addsuffix .cpp, $(FILES))
 TARGETS  := $(addsuffix .so, $(FILES))
 
 CLEAN    := *.so
@@ -70,7 +68,7 @@ clean:
 
 %.so: %.cpp Makefile
        @mkdir -p .depend
-       $(CXX) $(MODFLAGS) $(INCLUDES) $(LDFLAGS) -shared -o $@ $< $($(basename $<)FLAGS) -MMD -MF .depend/$<.dep
+       $(CXX) $(MODFLAGS) $(LDFLAGS) -shared -o $@ $< $($(basename $<)FLAGS) -MMD -MF .depend/$<.dep
 
 modperl_install: create_install_dir
        for i in *.pm; do \
index e9968600ab68f13c3347897e107a95dd7b13cf22..ad92b2f199b2a5622f3e86b3caba1ccbfaf6ef7d 100755 (executable)
@@ -6,8 +6,7 @@ datarootdir="@datarootdir@"
 bindir="@bindir@"
 datadir="@datadir@"
 
-CXXFLAGS="@MODFLAGS@"
-INCLUDES="-I@prefix@/include/znc @INCLUDES@"
+CXXFLAGS="@CPPFLAGS@ @MODFLAGS@ -I@prefix@/include/znc"
 # LIBS="@LIBS@"
 # No libs needed, ZNC links against $LIBS and thus modules don't need to.
 LIBS=""
@@ -18,7 +17,6 @@ VERSION="@VERSION@"
 if test -z "$1"; then
        echo "USAGE: $0 <--cflags|--include|--libs|--moddir|--datadir|--version|--prefix>"
        echo "  --cflags     [$CXXFLAGS]"
-       echo "  --include    [$INCLUDES]"
        echo "  --libs       [$LIBS]"
        echo "  --moddir     [$MODDIR]"
        echo "  --datadir    [$DATADIR]"
@@ -31,7 +29,8 @@ case $1 in
        --cflags)
                echo $CXXFLAGS;;
        --include)
-               echo $INCLUDES;;
+               # Left here for backwards compatibility
+               ;;
        --libs)
                echo $LIBS;;
        --moddir)