dnl ******************************************* dnl *** Initialize automake and set version *** dnl ******************************************* AC_PREREQ(2.53) AC_INIT(openwsman-yast, 1.5.9) AC_CONFIG_SRCDIR(src/yast.c) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AM_CONFIG_HEADER(wsman_yast_config.h) AM_MAINTAINER_MODE AC_PROG_MAKE_SET PKG_CHECK_MODULES(WSMAN, openwsman >= 1.5, [ WSMAN_VERSION=`$PKG_CONFIG --modversion openwsman`],[ AC_MSG_ERROR([need openwsman-devel version 1.5 or greater], [-1])]) AC_SUBST(WSMAN_VERSION) dnl *************************** dnl *** Set debugging flags *** dnl *************************** debug_default=minimum # Declare --enable-* args and collect ac_help strings AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],, enable_debug=$debug_default) # Set the debug flags if test "x$enable_debug" = "xyes"; then test "$cflags_set" = set || CFLAGS="$CFLAGS -g" OWSMAN_DEBUG_FLAGS="-DOWSMAN_ENABLE_DEBUG" CFLAGS="$CFLAGS -DDEBUG_VERBOSE" else if test "x$enable_debug" = "xno"; then OWSMAN_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS" fi fi # Set the debug flags if test "x$enable_debug" = "xyes"; then AC_DEFINE(WSMAN_DEBUG_VERBOSE, 1, [Defined if verbose debug logging is requested]) fi AC_SUBST(OWSMAN_DEBUG_FLAGS) # check for ssize_t AC_CHECK_TYPE(ssize_t, int) dnl *************************** dnl *** Checks for programs *** dnl *************************** AC_CHECK_FUNCS(strtok_r \ getpid \ strsep \ gettimeofday \ unlink \ syslog \ sleep \ fnmatch \ timegm \ daemon \ va_copy ) AC_PROG_CC AC_PROG_CXX AM_PROG_CC_STDC AC_PROG_INSTALL # Set STDC_HEADERS AC_HEADER_STDC # Initialize libtool AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL # This isn't a program, but it doesn't fit anywhere else... AC_FUNC_ALLOCA PKG_CHECK_MODULES(XML, libxml-2.0) AC_SUBST(XML_CFLAGS) AC_SUBST(XML_LIBS) dnl *********************** dnl *** Check for Win32 *** dnl *********************** AC_MSG_CHECKING([for Win32]) case "$host" in *-*-mingw*) os_win32=yes AC_CACHE_VAL(ac_cv_func_getaddrinfo, [ac_cv_func_getaddrinfo=yes]) AC_CACHE_VAL(ac_cv_func_getnameinfo, [ac_cv_func_getnameinfo=yes]) AC_CACHE_VAL(ac_cv_func_inet_pton, [ac_cv_func_inet_pton=yes]) AC_CACHE_VAL(ac_cv_func_inet_ntop, [ac_cv_func_inet_ntop=yes]) AC_CACHE_VAL(soup_cv_ipv6, [soup_cv_ipv6=yes]) ;; *) os_win32=no ;; esac AC_MSG_RESULT([$os_win32]) AM_CONDITIONAL(OS_WIN32, [test $os_win32 = yes]) dnl ******************* dnl *** Misc checks *** dnl ******************* AC_CHECK_FUNCS(gmtime_r) dnl ---------------------------------------------------------------------- AC_CHECK_HEADERS([inttypes.h stdlib.h]) AC_CHECK_HEADERS([net/if.h net/if_dl.h]) AC_CHECK_HEADERS([sys/ioctl.h sys/sockio.h]) AC_CHECK_HEADERS([crypt.h sys/ioctl.h dirent.h]) AC_CHECK_HEADERS([vararg.h stdarg.h pthread.h]) AC_CHECK_HEADERS([unistd.h sys/types.h sys/sendfile.h sys/signal.h]) AC_CHECK_HEADERS([ctype.h sys/resource.h sys/socket.h sys/select.h]) AC_CHECK_HEADERS([netinet/in.h], [], [], [#if HAVE_SYS_TYPES_H # include #endif ]) AC_HEADER_TIME dnl Checks for types AC_CHECK_TYPES([sa_family_t, in_port_t, in_addr_t], , , [ #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif #if HAVE_NETINET_IN_H # include #endif #if HAVE_ARPA_NAMESER_H # include #endif ]) AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) SIZEOF_SHORT=$ac_cv_sizeof_short SIZEOF_INT=$ac_cv_sizeof_int SIZEOF_LONG=$ac_cv_sizeof_long SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long AC_SUBST(SIZEOF_SHORT) AC_SUBST(SIZEOF_INT) AC_SUBST(SIZEOF_LONG) AC_SUBST(SIZEOF_LONG_LONG) AC_CHECK_FUNCS(srandom) AC_CHECK_MEMBER(struct sockaddr.sa_len, AC_DEFINE_UNQUOTED(HAVE_SA_LEN, 1, [Define if struct sockaddr contains sa_len]),, [#include #include ]) dnl ********************************* dnl *** Networking library checks *** dnl ********************************* AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket)) AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname)) AC_CHECK_FUNCS(inet_pton inet_ntop inet_aton getaddrinfo getnameinfo) AC_CACHE_CHECK(IPv6 support, soup_cv_ipv6, [ AC_EGREP_HEADER(sockaddr_in6, netinet/in.h, soup_cv_ipv6=yes, soup_cv_ipv6=no) ]) if test "$prefix" = "NONE"; then prefix=$ac_default_prefix; fi dnl Subst WSMAN_PLUGIN_DIR. dnl should come in via pkgconfig from openwsman ! wsmanplugindir=$libdir/openwsman/plugins WSMAN_PLUGIN_DIR="${wsmanplugindir}" AC_SUBST(WSMAN_PLUGIN_DIR) dnl ************************************* dnl *** Warnings to show if using GCC *** dnl ************************************* AC_ARG_ENABLE(more-warnings, [ --disable-more-warnings Inhibit compiler warnings], set_more_warnings=no) if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then CFLAGS="$CFLAGS \ -Wall -Wstrict-prototypes -Wmissing-declarations \ -Wmissing-prototypes -Wnested-externs -Wpointer-arith \ -Wunused -Werror" fi if test "$os_win32" != yes; then # Use reentrant functions (FIXME!) CFLAGS="$CFLAGS -D_REENTRANT" fi dnl ************************* dnl *** Output Everything *** dnl ************************* AC_SUBST(SYSCONFDIR) AC_CONFIG_FILES([ openwsman-yast.spec]) AC_OUTPUT([ Makefile src/Makefile ])