2005-11-12 16:27:19 -05:00
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
2006-07-21 21:02:36 -04:00
2005-11-12 16:27:19 -05:00
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
2006-03-30 09:43:39 -05:00
AC_CONFIG_AUX_DIR(build/config)
2005-11-12 16:27:19 -05:00
AM_INIT_AUTOMAKE(libfreeswitch,0.1)
AC_CONFIG_SRCDIR([src/switch.c])
2006-04-03 17:00:13 -04:00
AC_CONFIG_HEADER([src/include/switch_am_config.h])
2005-11-12 16:27:19 -05:00
2006-01-02 13:31:50 -05:00
AC_PREFIX_DEFAULT(/usr/local/freeswitch)
2006-01-05 18:13:00 -05:00
2006-12-16 18:22:45 -05:00
#Set default language
AC_LANG_C
2005-11-12 16:27:19 -05:00
# Checks for programs.
AC_PROG_CC
2006-03-29 21:12:50 -05:00
AC_PROG_AWK
2005-11-12 16:27:19 -05:00
AC_PROG_MAKE_SET
AC_PROG_INSTALL
2006-03-29 21:12:50 -05:00
AC_PROG_LIBTOOL
2005-11-12 16:27:19 -05:00
2006-12-16 18:22:45 -05:00
#Check for compiler vendor
AX_COMPILER_VENDOR
# Optimize
AC_ARG_ENABLE(optimization,
[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"])
if test "${enable_optimizer}" = "yes" ; then
AC_DEFINE([OPTIMZER],[],[Enable Optimization.])
AX_CC_MAXOPT
fi
# Enable debugging
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug],[build with debug information])],[enable_debug="$enable_debug"],[enable_debug="yes"])
if test "${enable_debug}" = "yes"; then
AC_DEFINE([DEBUG],[],[Enable extra debugging.])
AX_CFLAGS_WARN_ALL_ANSI
fi
AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
case "$host" in
*-solaris2*)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-DPATH_MAX=2048 -KPIC -DPIC"
new_AM_LDFLAGS="-L${prefix}/lib -R${prefix}/lib"
IN_LINE=""
elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-DPATH_MAX=2048 -fPIC"
new_AM_LDFLAGS=""
IN_LINE=inline
fi
DYNAMIC_LIB_EXTEN="so"
;;
*-darwin*)
if test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-dynamic -bundle -force-flat-namespace"
new_AM_CFLAGS="-DMACOSX"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="dylib"
IN_LINE=inline
;;
x86_64-*-linux-gnu)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-L${prefix}/lib -R${prefix}/lib"
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="so"
IN_LINE=inline
;;
i*6-*-linux-gnu)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-L${prefix}/lib -R${prefix}/lib"
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fpic"
new_AM_LDFLAGS=""
fi
IN_LINE=inline
DYNAMIC_LIB_EXTEN="so"
;;
2006-12-18 19:47:37 -05:00
*)
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
new_AM_CFLAGS="-KPIC -DPIC"
new_AM_LDFLAGS="-L${prefix}/lib -R${prefix}/lib"
elif test "x${ax_cv_c_compiler_vendor}"="xgnu" ; then
SOLINK="-shared -Xlinker -x"
new_AM_CFLAGS="-fPIC"
new_AM_LDFLAGS=""
fi
DYNAMIC_LIB_EXTEN="so"
IN_LINE=inline
;;
2006-12-16 18:22:45 -05:00
esac
AC_SUBST(new_AM_CFLAGS)
AC_SUBST(new_AM_LDFLAGS)
AC_SUBST(SOLINK)
AC_SUBST(DYNAMIC_LIB_EXTEN)
AC_DEFINE_UNQUOTED([inline],[$IN_LINE],[sunpro is bad at inline])
AC_DEFINE_UNQUOTED([__inline__],[$IN_LINE],[sunpro is bad at inline])
2005-11-12 16:27:19 -05:00
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
2005-11-18 19:10:16 -05:00
AC_CHECK_HEADERS([sys/types.h])
2005-11-12 16:27:19 -05:00
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
2006-09-17 14:44:53 -04:00
AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep])
2005-11-12 16:27:19 -05:00
2006-12-16 20:01:09 -05:00
AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
2006-01-05 18:13:00 -05:00
2006-05-05 09:35:33 -04:00
AC_ARG_ENABLE(crash-protection,
[ --enable-crash-protection Compile with CRASH Protection],,[enable_crash_prot="no"])
2006-01-05 18:13:00 -05:00
2006-05-05 09:35:33 -04:00
AM_CONDITIONAL([CRASHPROT],[test "x$enable_crash_prot" != "xno"])
2006-01-05 18:13:00 -05:00
2005-12-21 11:24:37 -05:00
AC_CONFIG_FILES([Makefile])
2005-11-12 16:27:19 -05:00
2005-11-18 19:10:16 -05:00
AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
2005-12-13 16:26:03 -05:00
AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
2006-01-25 18:59:02 -05:00
AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64])
2005-11-18 19:10:16 -05:00
2006-01-05 18:13:00 -05:00
AC_OUTPUT([src/include/switch_version.h])