1
0
Fork 0
mbuni/mbuni/configure.ac

151 lines
4.4 KiB
Plaintext
Raw Normal View History

2005-03-10 07:42:27 +00:00
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(mbuni, 0.96, devel@mbuni.org)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([mmlib/mms_util.c])
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lcrypto':
# AC_CHECK_LIB([crypto], [main])
# FIXME: Replace `main' with a function in `-ldl':
AC_CHECK_LIB([dl], [dlsym])
# FIXME: Replace `main' with a function in `-liconv':
AC_CHECK_LIB([iconv], [libiconv], [LIBS="$LIBS -liconv"])
# FIXME: Replace `main' with a function in `-lm':
# AC_CHECK_LIB([m], [main])
# FIXME: Replace `main' with a function in `-lpthread':
AC_CHECK_LIB([pthread], [pthread_create])
# FIXME: Replace `main' with a function in `-lssl':
# AC_CHECK_LIB([ssl], [main])
# FIXME: Replace `main' with a function in `-lxml2':
AC_CHECK_LIB([xml2], [xmlStrcasecmp], [],
AC_MSG_ERROR([LibXML2 is required]))
# FIXME: Replace `main' with a function in `-lz':
# AC_CHECK_LIB([z], [main])
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([float.h memory.h stdlib.h string.h sys/file.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_STRUCT_TM
AC_C_VOLATILE
# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_CHECK_FUNCS([floor localtime_r memset sqrt strerror strrchr strtol])
# Change a few things (a la kannel config)
EXE_EXT=""
case "$host" in
*-sun-solaris*)
CFLAGS="$CFLAGS -DSunOS=1"
;;
*-cygwin*)
EXE_EXT=".exe"
;;
*apple-darwin*)
CFLAGS="$CFLAGS -DDARWIN=1"
LIBTOOL="libtool -static -o"
;;
*-linux-*)
CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE"
LDFLAGS="$LDFLAGS -rdynamic"
;;
*-*-openbsd* | *-*-freebsd*)
CFLAGS="$CFLAGS -pthread"
AC_CHECK_LIB(c_r, pthread_exit, [LIBS="$LIBS -lc_r -lkse"; pthread="yes"])
;;
esac
AC_SUBST(EXE_EXT)
# AC_SUBST(LIBTOOL)
AC_ARG_WITH(cflags,
[ --with-cflags=FLAGS use FLAGS for CFLAGS],
CFLAGS="$CFLAGS $withval")
AC_ARG_WITH(libs,
[ --with-libs=FLAGS use FLAGS for extra libraries],
LIBS="$LIBS $withval")
# Need to check for kannel and also that kannel has been patched.
dnl Implement the --with-kannel-dir option
AC_ARG_WITH(kannel-dir,
[ --with-kannel-dir=DIR where to look for Kannel Gateway libs and header files
DIR points to the installation [/usr/local] ]
,
[
gwloc=""
if test -d "$withval" ; then
gwloc="$withval"
fi
])
AC_PATH_PROG(GW_CONFIG, gw-config, no, [$PATH:$gwloc/bin:$gwloc])
dnl check for Kannel gw-config
if test "$GW_CONFIG" = "no"; then
found=""
for loc in $pgsqlloc /usr /usr/local ; do
if test "x$found" = "x" ; then
AC_MSG_CHECKING([for Kannel include files in])
AC_MSG_RESULT($loc)
AC_CHECK_FILE("$loc/include/kannel/gw-config.h",
[CFLAGS="$CFLAGS -I$loc/include/kannel";
LIBS="$LIBS -L$loc/lib/kannel -lwap -lgwlib";
found=1
])
fi
done;
if test "x$found" != "x1" ; then
AC_MSG_ERROR([Unable to find gw-config.h, please provide a --with-kannel-dir=
<dir> location])
fi
else
dnl gw_config found
AC_MSG_CHECKING([Kannel version])
gw_version=`$GW_CONFIG --version`
AC_MSG_RESULT([$gw_version])
AC_MSG_CHECKING([Kannel libs])
if ! $GW_CONFIG --libs &>/dev/null ; then
LIBS="$LIBS `$GW_CONFIG --libs`"
gw_libdir=`$GW_CONFIG --libs`
AC_MSG_RESULT([$gw_libdir])
fi
AC_MSG_CHECKING([Kannel includes])
if ! $GW_CONFIG --cflags &>/dev/null ; then
CFLAGS="$CFLAGS `$GW_CONFIG --cflags`"
gw_incdir=`$GW_CONFIG --cflags`
AC_MSG_RESULT([$gw_incdir])
fi
fi
AC_CHECK_LIB([gwlib], [cfg_create], [], AC_MSG_ERROR([Kannel gwlib is required!]))
AC_CHECK_LIB([wap], [wsp_headers_pack], [], AC_MSG_ERROR([Kannel WAP lib is required!]))
CFLAGS="-I$srcdir/../mmlib $CFLAGS"
LIBS="-L$srcdir/../mmlib -lmms $LIBS"
# May be we need to check for media conversion tools (imagemagick, etc)?
AC_CONFIG_FILES([Makefile mmlib/Makefile mmsc/Makefile])
AC_OUTPUT