# -*- Autoconf -*- AC_INIT([libppswrapper], [0.0.18.2]) dnl AC_INIT([$PACKAGE], [$VERSION]) AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode dnl AM_MAINTAINER_MODE AM_INIT_AUTOMAKE dnl make aclocal work in maintainer mode AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") dnl check for tools AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_AWK AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL dnl Add the languages which your application supports to po/LINGUAS # Checks for header files. AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_INT64_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T # Checks for library functions. AC_FUNC_FORK AC_FUNC_MALLOC AC_CHECK_FUNCS([memset select socket strerror]) dnl decide on error flags AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no") if test "x$GST_WALL" = "xyes"; then GST_ERROR="$GST_ERROR -Wall" if test "x$LIBPPSWRAPPER_CVS" = "xyes"; then AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR") fi fi dnl Check for pkgconfig first dnl AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) dnl Give error and exit if we don't have pkgconfig dnl if test "x$HAVE_PKGCONFIG" = "xno"; then dnl AC_MSG_ERROR(you need to have pkgconfig installed !) dnl fi savedLDFLAGS=$LDFLAGS savedLIB=$LIBS AC_LANG(C++) PPS_DEP_LIBS='-lppsbase -lppssg -lppsvodres -lppsfds -lppsvodnet' LIBS="-lppsapi $PPS_DEP_LIBS $LIBS" PPS_LIBS= PPS32_LIBS= WRAPPER_LDFLAGS="-pthread -lppsapi $PPS_DEP_LIBS" WRAPPER_CFLAGS="-pthread" WRAPPER_PRELOAD_LDFLAGS="-avoid-version -ldl" WRAPPER_PRELOAD_CFLAGS= AC_MSG_CHECKING([whether pps libraris is available]) AC_LINK_IFELSE(AC_LANG_CALL([], ppsvod_create), [AC_MSG_RESULT(yes) HAVE_PPS="yes"], [AC_MSG_RESULT(no) HAVE_PPS="no"]) if test "x$HAVE_PPS" = "xyes"; then PPS_LIBS="-lppsapi $PPS_DEP_LIBS" # AC_DEFINE_UNQUOTED(HAVE_LIBPPS) else AC_MSG_CHECKING([whether pps 32bit libraris is available]) saved32LDFLAGS=$LDFLAGS LDFLAGS="-m32 $LDFLAGS" AC_LINK_IFELSE(AC_LANG_CALL([], ppsvod_destroy), [ HAVE_PPS32="yes" AC_MSG_RESULT(yes)], [ HAVE_PPS32="no" AC_MSG_RESULT(no)]) if test "x$HAVE_PPS32" = "xyes"; then PPS32_LIBS="-lppsapi $PPS_DEP_LIBS" else AC_MSG_ERROR(['couldn't find pps libraries.]) fi LDFLAGS=$saved32LDFLAGS WRAPPER_CFLAGS="-m32 $WRAPPER_CFLAGS" WRAPPER_LDFLAGS="-m32 $WRAPPER_LDFLAGS" WRAPPER_PRELOAD_CFLAGS="-m32 $WRAPPER_PRELOAD_CFLAGS" WRAPPER_PRELOAD_LDFLAGS="-m32 $WRAPPER_PRELOAD_LDFLAGS" use_wrapper=yes # AC_DEFINE_UNQUOTED(HAVE_LIBPPS32) fi LDFLAGS=$savedLDFLAGS LIBS=$savedLIB AC_LANG(C) AC_SUBST(PPS_LIBS) AC_SUBST(PPS32_LIBS) AC_SUBST(WRAPPER_LDFLAGS) AC_SUBST(WRAPPER_CFLAGS) AC_SUBST(WRAPPER_PRELOAD_LDFLAGS) AC_SUBST(WRAPPER_PRELOAD_CFLAGS) AC_OUTPUT(Makefile m4/Makefile wrapper/Makefile wrapper/ppswrapper-run-server)