blob: 0b005033de9f511fba78c032a06430a6ba8b3504 [file] [log] [blame]
dnl
dnl
AC_PREREQ(2.50)
AC_INIT(org.eclipse.ptp.debug.sdm, 2.1.4)
AC_CONFIG_SRCDIR(src/client/client.c)
AM_INIT_AUTOMAKE([subdir-objects])
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_BUILD
dnl
dnl Eclipse adds version number to end of package when deploying via update site
dnl
UTILS="../org.eclipse.ptp.utils"
if test ! -d $UTILS; then
UTILS="`echo ${UTILS}_${PACKAGE_VERSION}.*`"
if test ! -d $UTILS; then
AC_MSG_ERROR([utils directory not found])
fi
fi
PROXY="../org.eclipse.ptp.proxy"
if test ! -d $PROXY; then
PROXY="`echo ${PROXY}_${PACKAGE_VERSION}.*`"
if test ! -d $PROXY; then
AC_MSG_ERROR([proxy directory not found])
fi
fi
dnl
dnl Check for programs.
dnl
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
os=`uname -s`
if test "x$os" = "xAIX" ; then
CFLAGS="$CFLAGS -qinfo=gen -qcpluscmt"
else
CFLAGS="$CFLAGS -Wall"
fi
CFLAGS="$CFLAGS -I$UTILS/include -I$PROXY/include"
LIBS="$LIBS -L$UTILS -L$PROXY"
dnl
dnl Check for libraries.
dnl
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, socket)
AC_SEARCH_LIBS(openpty, [util],
[AC_DEFINE(HAVE_OPENPTY, 1, [System has openpty() function.])])dnl
AC_CHECK_LIB(utils, bitset_new)
AC_CHECK_LIB(proxysvr, proxy_svr_init, [SVR_LIBS="$SVR_LIBS -lproxysvr"])
AC_SUBST([SVR_LIBS])
AC_CHECK_LIB(proxyclnt, proxy_clnt_init, [CLNT_LIBS="$CLNT_LIBS -lproxyclnt"])
AC_SUBST([CLNT_LIBS])
dnl Check for posix4
AC_CHECK_LIB(posix4, clock_gettime)
if test "$ac_cv_lib_posix4_clock_gettime" = yes; then
AC_DEFINE(POSIX, 1, [Enable POSIX support in Guard.])
LIBS="$LIBS -lposix4"
fi
dnl
dnl Check for header files.
dnl
AC_HEADER_STDC
AC_CHECK_HEADERS(strings.h sys/time.h unistd.h)
AC_CHECK_HEADERS(jni.h)
AM_CONDITIONAL(PTPDBGJNI, [test "$ac_cv_header_jni_h" = yes])
dnl
dnl Check for typedefs, structures, and compiler characteristics.
dnl
AC_HEADER_TIME
AC_STRUCT_TM
dnl
dnl Check for library functions.
dnl
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gethostname select strdup strstr strtoul sigset sighold sigrelse)
AH_VERBATIM([DEBUG],
[#define DEBUG
#ifdef DEBUG
extern int debug_level;
extern void debug_printf(int, char *, ...);
#define DEBUG_LEVEL_NONE 0x00
#define DEBUG_LEVEL_ALL 0xff
#define DEBUG_LEVEL_STARTUP 0x01
#define DEBUG_LEVEL_CLIENT 0x02
#define DEBUG_LEVEL_SERVER 0x04
#define DEBUG_LEVEL_BACKEND 0x08
#define TEST_DEBUG_LEVEL(level) ((debug_level&(level))==(level))
#define DEBUG_PRINTF(level,format,...) debug_printf((level),(format),__VA_ARGS__)
#define DEBUG_PRINTS(level,str) debug_printf((level),"%s",(str))
#else /* DEBUG */
#define DEBUG_PRINTF(level,format,...)
#define DEBUG_PRINTS(level,str)
#endif /* DEBUG */])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_SUBDIRS([libaif])
AC_OUTPUT