initial version
This commit is contained in:
62
m4/ac_check_debugging.m4
Normal file
62
m4/ac_check_debugging.m4
Normal file
@ -0,0 +1,62 @@
|
||||
dnl ##
|
||||
dnl ## Debugging Support
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_CHECK_DEBUGGING
|
||||
dnl ##
|
||||
|
||||
AC_DEFUN([AC_CHECK_DEBUGGING],[dnl
|
||||
AC_ARG_ENABLE(debug,dnl
|
||||
[ --enable-debug build for debugging (default=no)],
|
||||
[dnl
|
||||
if test ".$ac_cv_prog_gcc" = ".yes"; then
|
||||
case "$CFLAGS" in
|
||||
*-O* ) ;;
|
||||
* ) CFLAGS="$CFLAGS -O2" ;;
|
||||
esac
|
||||
case "$CFLAGS" in
|
||||
*-g* ) ;;
|
||||
* ) CFLAGS="$CFLAGS -g" ;;
|
||||
esac
|
||||
case "$CFLAGS" in
|
||||
*-pipe* ) ;;
|
||||
* ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe")
|
||||
;;
|
||||
esac
|
||||
case $PLATFORM in
|
||||
*-*-freebsd*|*-*-solaris* ) CFLAGS="$CFLAGS -pedantic" ;;
|
||||
esac
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
WMORE="-Wshadow -Wpointer-arith -Wcast-align -Winline"
|
||||
WMORE="$WMORE -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
|
||||
AC_COMPILER_OPTION(wmore, -W<xxx>, $WMORE, CFLAGS="$CFLAGS $WMORE")
|
||||
AC_COMPILER_OPTION(wnolonglong, -Wno-long-long, -Wno-long-long, CFLAGS="$CFLAGS -Wno-long-long")
|
||||
AC_COMPILER_OPTION(fnostrictaliasing, -fno-strict-aliasing, -fno-strict-aliasing, CFLAGS="$CFLAGS -fno-strict-aliasing")
|
||||
else
|
||||
case "$CFLAGS" in
|
||||
*-g* ) ;;
|
||||
* ) CFLAGS="$CFLAGS -g" ;;
|
||||
esac
|
||||
fi
|
||||
msg="enabled"
|
||||
AC_DEFINE(DEBUG, 1, [define to enable debugging])
|
||||
],[
|
||||
if test ".$ac_cv_prog_gcc" = ".yes"; then
|
||||
case "$CFLAGS" in
|
||||
*-pipe* ) ;;
|
||||
* ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;
|
||||
esac
|
||||
fi
|
||||
case "$CFLAGS" in
|
||||
*-g* ) CFLAGS=`echo "$CFLAGS" |\
|
||||
sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
|
||||
esac
|
||||
case "$CXXFLAGS" in
|
||||
*-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\
|
||||
sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
|
||||
esac
|
||||
msg="disabled"
|
||||
])dnl
|
||||
AC_MSG_CHECKING(for compilation debug mode)
|
||||
AC_MSG_RESULT([$msg])
|
||||
])
|
19
m4/ac_check_libm.m4
Normal file
19
m4/ac_check_libm.m4
Normal file
@ -0,0 +1,19 @@
|
||||
# AC_CHECK_LIBM
|
||||
# -------------
|
||||
# check for math library
|
||||
AC_DEFUN([AC_CHECK_LIBM],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
LIBM=
|
||||
case $host in
|
||||
*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
|
||||
# These system don't have libm, or don't need it
|
||||
;;
|
||||
*-ncr-sysv4.3*)
|
||||
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
||||
AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_LIB(m, cos, LIBM="-lm")
|
||||
;;
|
||||
esac
|
||||
])# AC_CHECK_LIBM
|
27
m4/ac_check_profiling.m4
Normal file
27
m4/ac_check_profiling.m4
Normal file
@ -0,0 +1,27 @@
|
||||
dnl ##
|
||||
dnl ## Profiling Support
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_CHECK_PROFILING
|
||||
dnl ##
|
||||
|
||||
AC_DEFUN([AC_CHECK_PROFILING],[dnl
|
||||
AC_MSG_CHECKING(for compilation profile mode)
|
||||
AC_ARG_ENABLE(profile,dnl
|
||||
[ --enable-profile build for profiling (default=no)],
|
||||
[dnl
|
||||
if test ".$ac_cv_prog_gcc" = ".no"; then
|
||||
AC_MSG_ERROR([profiling requires gcc and gprof])
|
||||
fi
|
||||
CFLAGS=`echo "$CFLAGS" | sed -e 's/-O2//g'`
|
||||
CFLAGS="$CFLAGS -O0 -pg"
|
||||
LDFLAGS="$LDFLAGS -pg"
|
||||
msg="enabled"
|
||||
],[
|
||||
msg="disabled"
|
||||
])dnl
|
||||
AC_MSG_RESULT([$msg])
|
||||
if test ".$msg" = .enabled; then
|
||||
enable_shared=no
|
||||
fi
|
||||
])
|
29
m4/ac_compiler_option.m4
Normal file
29
m4/ac_compiler_option.m4
Normal file
@ -0,0 +1,29 @@
|
||||
dnl ##
|
||||
dnl ## Check whether compiler option works
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_COMPILER_OPTION(<name>, <display>, <option>,
|
||||
dnl ## <action-success>, <action-failure>)
|
||||
dnl ##
|
||||
|
||||
AC_DEFUN([AC_COMPILER_OPTION],[dnl
|
||||
AC_MSG_CHECKING(for compiler option $2)
|
||||
AC_CACHE_VAL(ac_cv_compiler_option_$1,[
|
||||
cat >conftest.$ac_ext <<EOF
|
||||
int main() { return 0; }
|
||||
EOF
|
||||
${CC-cc} -c $CFLAGS $CPPFLAGS $3 conftest.$ac_ext 1>conftest.out 2>conftest.err
|
||||
if test $? -ne 0 -o -s conftest.err; then
|
||||
ac_cv_compiler_option_$1=no
|
||||
else
|
||||
ac_cv_compiler_option_$1=yes
|
||||
fi
|
||||
rm -f conftest.$ac_ext conftest.out conftest.err
|
||||
])dnl
|
||||
if test ".$ac_cv_compiler_option_$1" = .yes; then
|
||||
ifelse([$4], , :, [$4])
|
||||
else
|
||||
ifelse([$5], , :, [$5])
|
||||
fi
|
||||
AC_MSG_RESULT([$ac_cv_compiler_option_$1])
|
||||
])dnl
|
47
m4/ac_headline.m4
Normal file
47
m4/ac_headline.m4
Normal file
@ -0,0 +1,47 @@
|
||||
dnl ##
|
||||
dnl ## Support for Configuration Headers
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_HEADLINE(<short-name>, <long-name>,
|
||||
dnl ## <vers-var>, <vers-file>,
|
||||
dnl ## <copyright>)
|
||||
dnl ##
|
||||
|
||||
AC_DEFUN([AC_HEADLINE],[dnl
|
||||
# configuration header
|
||||
if test ".`echo dummy [$]@ | grep enable-subdir`" != .; then
|
||||
enable_subdir=yes
|
||||
fi
|
||||
if test ".`echo dummy [$]@ | grep help`" = .; then
|
||||
# bootstrapping shtool
|
||||
ac_prog=[$]0
|
||||
changequote(, )dnl
|
||||
ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'`
|
||||
changequote([, ])dnl
|
||||
test ".$ac_srcdir" = ".$ac_prog" && ac_srcdir=.
|
||||
ac_shtool="${CONFIG_SHELL-/bin/sh} $ac_srcdir/shtool"
|
||||
|
||||
# find out terminal sequences
|
||||
if test ".$enable_subdir" != .yes; then
|
||||
TB=`$ac_shtool echo -n -e %B 2>/dev/null`
|
||||
TN=`$ac_shtool echo -n -e %b 2>/dev/null`
|
||||
else
|
||||
TB=''
|
||||
TN=''
|
||||
fi
|
||||
|
||||
# find out package version
|
||||
$3_STR="`$ac_shtool version -lc -dlong $ac_srcdir/$4`"
|
||||
AC_SUBST($3_STR)
|
||||
|
||||
# friendly header ;)
|
||||
if test ".$enable_subdir" != .yes; then
|
||||
echo "Configuring ${TB}$1${TN} ($2), Version ${TB}${$3_STR}${TN}"
|
||||
echo "$5"
|
||||
fi
|
||||
|
||||
# additionally find out hex version
|
||||
$3_HEX="`$ac_shtool version -lc -dhex $ac_srcdir/$4`"
|
||||
AC_SUBST($3_HEX)
|
||||
fi
|
||||
])dnl
|
13
m4/ac_msg_part.m4
Normal file
13
m4/ac_msg_part.m4
Normal file
@ -0,0 +1,13 @@
|
||||
dnl ##
|
||||
dnl ## Display Configuration Headers
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_MSG_PART(<text>)
|
||||
dnl ##
|
||||
|
||||
AC_DEFUN([AC_MSG_PART],[dnl
|
||||
if test ".$enable_subdir" != .yes; then
|
||||
AC_MSG_RESULT()
|
||||
AC_MSG_RESULT(${TB}$1:${TN})
|
||||
fi
|
||||
])dnl
|
13
m4/ac_msg_silent.m4
Normal file
13
m4/ac_msg_silent.m4
Normal file
@ -0,0 +1,13 @@
|
||||
dnl ##
|
||||
dnl ## Do not display message for a command
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_MSG_SILENT(...)
|
||||
dnl ##
|
||||
|
||||
m4_define(AC_FD_TMP, 9)
|
||||
m4_define([AC_MSG_SILENT],[dnl
|
||||
exec AC_FD_TMP>&AC_FD_MSG AC_FD_MSG>/dev/null
|
||||
$1
|
||||
exec AC_FD_MSG>&AC_FD_TMP AC_FD_TMP>&-
|
||||
])
|
12
m4/ac_msg_verbose.m4
Normal file
12
m4/ac_msg_verbose.m4
Normal file
@ -0,0 +1,12 @@
|
||||
dnl ##
|
||||
dnl ## Display a message under --verbose
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_MSG_VERBOSE(<text>)
|
||||
dnl ##
|
||||
|
||||
m4_define([AC_MSG_VERBOSE],[dnl
|
||||
if test ".$verbose" = .yes; then
|
||||
AC_MSG_RESULT([ $1])
|
||||
fi
|
||||
])
|
13
m4/ac_once.m4
Normal file
13
m4/ac_once.m4
Normal file
@ -0,0 +1,13 @@
|
||||
dnl ##
|
||||
dnl ## Perform something only once
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_ONCE(<action>)
|
||||
dnl ##
|
||||
|
||||
m4_define([AC_ONCE],[
|
||||
ifelse(ac_once_$1, already_done, ,[
|
||||
m4_define(ac_once_$1, already_done)
|
||||
$2
|
||||
])dnl
|
||||
])
|
19
m4/ac_platform.m4
Normal file
19
m4/ac_platform.m4
Normal file
@ -0,0 +1,19 @@
|
||||
dnl ##
|
||||
dnl ## Support for Platform IDs
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_PLATFORM(<variable>)
|
||||
dnl ##
|
||||
|
||||
AC_DEFUN([AC_PLATFORM],[
|
||||
if test ".$host" != .; then
|
||||
$1="$host"
|
||||
else
|
||||
$1=`$ac_config_guess`
|
||||
fi
|
||||
$1=`$ac_config_sub $$1` || exit 1
|
||||
AC_SUBST($1)
|
||||
if test ".$enable_subdir" != .yes; then
|
||||
echo "Platform: ${TB}${$1}${TN}"
|
||||
fi
|
||||
])dnl
|
18
m4/ac_samba_va_copy.m4
Normal file
18
m4/ac_samba_va_copy.m4
Normal file
@ -0,0 +1,18 @@
|
||||
dnl VA_COPY
|
||||
AC_CACHE_CHECK([for va_copy],samba_cv_HAVE_VA_COPY,[
|
||||
AC_TRY_LINK([#include <stdarg.h>
|
||||
va_list ap1,ap2;], [va_copy(ap1,ap2);],
|
||||
samba_cv_HAVE_VA_COPY=yes,samba_cv_HAVE_VA_COPY=no)])
|
||||
if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then
|
||||
AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
|
||||
fi
|
||||
|
||||
if test x"$samba_cv_HAVE_VA_COPY" != x"yes"; then
|
||||
AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE___VA_COPY,[
|
||||
AC_TRY_LINK([#include <stdarg.h>
|
||||
va_list ap1,ap2;], [__va_copy(ap1,ap2);],
|
||||
samba_cv_HAVE___VA_COPY=yes,samba_cv_HAVE___VA_COPY=no)])
|
||||
if test x"$samba_cv_HAVE___VA_COPY" = x"yes"; then
|
||||
AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
|
||||
fi
|
||||
fi
|
27
m4/ac_srcdir_prefix.m4
Normal file
27
m4/ac_srcdir_prefix.m4
Normal file
@ -0,0 +1,27 @@
|
||||
dnl ##
|
||||
dnl ## Support for $(S)
|
||||
dnl ##
|
||||
dnl ## configure.ac:
|
||||
dnl ## AC_SRCDIR_PREFIX(<varname>)
|
||||
dnl ##
|
||||
|
||||
AC_DEFUN([AC_SRCDIR_PREFIX],[
|
||||
ac_prog=[$]0
|
||||
changequote(, )dnl
|
||||
ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'`
|
||||
changequote([, ])dnl
|
||||
if test ".$ac_srcdir" = ".$ac_prog"; then
|
||||
ac_srcdir=""
|
||||
elif test "x$ac_srcdir" = "x."; then
|
||||
ac_srcdir=""
|
||||
else
|
||||
if test ".$CFLAGS" = .; then
|
||||
CFLAGS="-I$ac_srcdir"
|
||||
else
|
||||
CFLAGS="$CFLAGS -I$ac_srcdir"
|
||||
fi
|
||||
ac_srcdir="$ac_srcdir/"
|
||||
fi
|
||||
$1="$ac_srcdir"
|
||||
AC_SUBST($1)
|
||||
])dnl
|
Reference in New Issue
Block a user