dnl Define the input and output configuration header file.
AC_CONFIG_HEADER([config.h])
-dnl Demand at least version 2.50 of autoconf
-AC_PREREQ(2.50)
+dnl Demand at least version 2.59 of autoconf (for AS_HELP_STRING)
+AC_PREREQ(2.59)
dnl Find out what type of system we are
AC_CANONICAL_HOST
dnl ANSIfy the C compiler whenever possible.
AM_PROG_CC_STDC
-dnl Use -O3 instead of -O2.
-if test x"$CFLAGS" != x; then
- CFLAGS=`echo "$CFLAGS" | sed -e 's/-O2/-O3/'`
+dnl Allow specification of optimization level.
+AC_ARG_WITH([optimization],
+ AS_HELP_STRING([--with-optimization=[-O2]], [Explicitly set the compiler optimization flags (default: -O3)]),
+ [unet_cv_optimization=$withval],
+ [unet_cv_optimization='-O3'])
+AC_CACHE_CHECK([optimization level], [unet_cv_optimization], [unet_cv_optimization='-O3'])
+if test "x$unet_cv_optimization" = "xno" ; then
+ unet_cv_optimization=""
fi
-dnl Remove -pipe during configure
if test x"$CFLAGS" != x; then
- CFLAGS=`echo "$CFLAGS" | sed -e 's/-pipe//g'`
+ CFLAGS=`echo "$CFLAGS" | sed -e s/-O2/$unet_cv_optimization/`
fi
dnl Notice the -g flag and deal accordingly
if test x"$CFLAGS" != x; then
AC_MSG_WARN([$YACC may not work as yacc.])
fi
-
unet_NONBLOCKING
unet_SIGNALS
-dnl Add -pipe when possible
-unet_PIPE_CFLAGS
-
dnl Check OS for os_dep files.
AC_MSG_CHECKING(for OS-dependent information)
case "$host" in