[go: up one dir, main page]

Menu

[r990]: / base / trunk / configure.ac  Maximize  Restore  History

Download this file

193 lines (167 with data), 6.9 kB

#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.57)
AC_INIT(omc-base, 1.0.1)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src])
AC_CONFIG_HEADER([config.h])
AC_PROG_LIBTOOL

AC_PREFIX_DEFAULT(/usr)

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LEX
AC_PROG_YACC

AC_PATH_PROG(RM, rm, rm)
AC_PATH_PROG(MV, mv, mv)
AC_PATH_PROG(CP, cp, cp)

DEBUG_FLAGS="-DDEBUG -g" # Additional debugging flags.
FULL_DEBUG_FLAGS="-D_GLIBCXX_DEBUG"	# Additional debugging flags.
OPT_FLAGS="  -DNDEBUG -O2"	# Additional optimization flags.


##NOTE:  whereever CXXFLAGS is used, we need to also use CPPFLAGS, for the AC_CHECK_HEADERS - 
##       It now uses compile (primarily) but still uses pre-processor for interim transition / backward compatibility
##       pre-processor needs the CPPFLAGS


#######################################################################
# Process additional search dirs if specified
AC_ARG_WITH(search-dir,
	[ --with-search-dir=PATH   Specify an additional directory to look for include/ and lib/ sub dirs ],
	[
      if test "x$withval" != "xno" ; then
        	CXXFLAGS="$CXXFLAGS -I$withval/include" 
        	CPPFLAGS="$CPPFLAGS -I$withval/include" 
        	CFLAGS="$CFLAGS -I$withval/include" 
        	LDFLAGS="$LDFLAGS -L$withval/lib" 
      fi
	]
)

#######################################################################
interop_namespace="root/interop"
AC_ARG_WITH(interop-namespace,
	[ --with-interop-namespace=NS   Specifiy the namespace for INTEROP specific data. default = root/interop ],
	[
      if test "x$withval" != "xno" ; then
	  		interop_namespace="$withval"
      fi
	]
)

AC_DEFINE_UNQUOTED(INTEROP_NAMESPACE, "${interop_namespace}", "The namespace for INTEROP specific data")

debuglevel="0"
#######################################################################
# Set the debug flag if specified
AC_ARG_ENABLE(debug-mode,
        [--enable-debug-mode Enable debugging mode],
        [
			debuglevel="1"
        ]
)

AC_ARG_WITH(debug-level,
	[ --with-debug-level=LEVEL   Specify a debug level valid values: 0=none 1=partial debug 2=full debug ],
	[
		case "x$withval" in
		x0|xno)
			debuglevel="0";;
		x1)
			debuglevel="1";;
		x2)
			debuglevel="2";;
		*)
			AC_MSG_WARN("Invalid debug level specified. Valid values are 0, 1 or 2")
			exit 1;;
		esac
	]
)

case $debuglevel in
1)
	AC_DEFINE(SMASH_DEBUG, 1, "Debugging flag.")
	CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS -Wall"
	CPPFLAGS="$CPPFLAGS $DEBUG_FLAGS -Wall"
	CFLAGS="  $CFLAGS   $DEBUG_FLAGS -Wall"
	LDFLAGS=" $LDFLAGS  $DEBUG_FLAGS";;
2)
	AC_DEFINE(SMASH_DEBUG, 2, "Debugging flag.")
	CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS $FULL_DEBUG_FLAGS -Wall"
	CPPFLAGS="$CPPFLAGS $DEBUG_FLAGS $FULL_DEBUG_FLAGS -Wall"
	CFLAGS="  $CFLAGS   $DEBUG_FLAGS $FULL_DEBUG_FLAGS -Wall"
	LDFLAGS=" $LDFLAGS  $DEBUG_FLAGS $FULL_DEBUG_FLAGS";;
*)
	CXXFLAGS="$CXXFLAGS $OPT_FLAGS -Wall"
	CPPFLAGS="$CPPFLAGS $OPT_FLAGS -Wall"
	CFLAGS="  $CFLAGS   $OPT_FLAGS -Wall"
	LDFLAGS=" $LDFLAGS  $OPT_FLAGS";;
esac

#####################################################

# Checks for libraries.
#AC_CHECK_LIB([owcimomcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owclient], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owcppprovifc], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owdb], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owhttpclient], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owhttpcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owhttpxmllistener], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owprovider], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owrepositoryhdb], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owserver], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owservicehttp], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owwql], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owwqlcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([owxml], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([pthread], [main], [LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
#AC_CHECK_LIB([crypto], [main], [LIBS="$LIBS"], [AC_MSG_ERROR(Must have libcrypto \(openssl-devel\) or build will fail)])

# Checks for two basic and common openwbem libraries
AC_CHECK_LIB([owcimomcommon], [main],[LIBS="$LIBS"],[AC_MSG_ERROR(Must have openwbem-devel or build will fail)])
AC_CHECK_LIB([owclient], [main], [LIBS="$LIBS"], [AC_MSG_ERROR(Must have openwbem-devel or build will fail)])


LIMAL_RUNLEVEL_LIBS=`pkg-config --libs limal-runlevel`
AC_SUBST(LIMAL_RUNLEVEL_LIBS)

# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([openwbem/OW_config.h fcntl.h stdlib.h string.h unistd.h sys/time.h openssl/evp.h sys/param.h sys/vfs.h],,[AC_MSG_ERROR(Missing headers: likely won't compile)])

# Only build init.d provider if limal headers are present
AC_CHECK_HEADER([limal/runlevel/config.h],[HAVE_LIMAL_RUNLEVEL="1"],[HAVE_LIMAL_RUNLEVEL="0"])
AM_CONDITIONAL(DO_INITD_PROVIDER, test "$HAVE_LIMAL_RUNLEVEL" = 1)

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_UID_T
AC_HEADER_TIME
AC_TYPE_MODE_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T

# Checks for library functions.
AC_FUNC_CLOSEDIR_VOID
AC_REPLACE_FNMATCH
AC_FUNC_FORK
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_CHOWN
AC_FUNC_SETVBUF_REVERSED
AC_FUNC_STAT
AC_FUNC_STRERROR_R

AC_CHECK_FUNCS([gettimeofday memset regcomp strchr strdup strerror strstr strtol strtoul uname])

AC_CONFIG_FILES([Makefile
	src/Makefile
	src/lib/Makefile
	src/lib/omc/Makefile
	src/include/Makefile
	src/include/omc/Makefile
	src/providers/Makefile
	src/providers/processes/Makefile
	src/providers/operating-system/Makefile
	src/providers/computer-system/Makefile
	src/providers/posix-file-elements/Makefile
	src/providers/file-system/Makefile
	src/providers/time-service/Makefile
	src/providers/initd/Makefile
	src/providers/syslog/Makefile
	test/Makefile
	test/unit/Makefile
	])
AC_OUTPUT