[go: up one dir, main page]

Menu

[r1169]: / clp / trunk / configure.ac  Maximize  Restore  History

Download this file

225 lines (201 with data), 6.4 kB

AC_INIT(src/omcclp.cpp)
AC_CONFIG_AUX_DIR(config)

AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(omcclp, 0.7)

AC_LANG_CPLUSPLUS
AC_PROG_CXX
AM_PROG_LIBTOOL
AM_PROG_LEX
AC_PROG_YACC

if ! env | grep "CXXFLAGS"; then
	CXXFLAGS=""
fi
if ! env | grep "CPPFLAGS"; then
	CPPFLAGS=""
fi
if ! env | grep "CFLAGS"; then
	CFLAGS=""
fi
if ! env | grep "LDFLAGS"; then
	LDFLAGS=""
fi
	
#CXXFLAGS=""
#CPPFLAGS=""
#CFLAGS=""
#LDFLAGS=""

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

#######################################################################
# Allow the user to specify which pieces of OMC to build:
# omcclp, omcclpc, omcclpd
AC_ARG_ENABLE([omcclpcomb], 
[  --disable-omcclpcomb    Disable the combined client/daemon build (omcclp)],
[omcclpcomb=false],[omcclpcomb=true])
AM_CONDITIONAL([OMCCLPCOMB], [test x$omcclpcomb = xtrue])

AC_ARG_ENABLE([omcclpc], 
[  --disable-omcclpc       Disable the client build (omcclpc)],
[ omcclpc=false],[omcclpc=true])
AM_CONDITIONAL([OMCCLPC], [test x$omcclpc = xtrue])

AC_ARG_ENABLE([omcclpd], 
[  --disable-omcclpd       Disable the daemon build (omcclpd)],
[ omcclpd=false],[omcclpd=true])
AM_CONDITIONAL([OMCCLPD], [test x$omcclpd = xtrue])

#######################################################################
# Set the debug flag if specified
AC_ARG_ENABLE(debug-mode,
[--enable-debug-mode Enable debugging mode],
[
	AC_DEFINE(CLP_DEBUG, 1, "Debugging flag.")
	CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS"
#	CPPFLAGS="$CPPFLAGS $DEBUG_FLAGS"
	CFLAGS="  $CFLAGS   $DEBUG_FLAGS"
	LDFLAGS=" $LDFLAGS  $DEBUG_FLAGS"
],[
	CXXFLAGS="$CXXFLAGS $OPT_FLAGS"
#	CPPFLAGS="$CPPFLAGS $OPT_FLAGS"
	CFLAGS="  $CFLAGS   $OPT_FLAGS"
	LDFLAGS=" $LDFLAGS  $OPT_FLAGS"
]
)

#######################################################################
# 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
	]
)

#######################################################################
AC_ARG_WITH(openwbem-dir,
	[ --with-openwbem-dir=PATH   Specify an additional directory to look for openwbem 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
	]
)

# Checks for header files.
AC_CHECK_HEADERS(openwbem/OW_config.h,,[AC_MSG_ERROR(Missing OpenWBEM headers: likely won't compile)])
AC_CHECK_HEADERS(readline/readline.h,,[AC_MSG_ERROR(Missing headers for readline library: likely won't compile)])

#######################################################################
AC_ARG_WITH(package-prefix,
	[ --with-package-prefix=PREFIX specify an optional prefix for 
		use when building a commercial version of the clp.  This allows separate 
		versions to simultaneously coexist. ],
	[
		PACKAGE_PREFIX=${with_package_prefix}
		PACKAGE_PREFIX_D=${with_package_prefix}-
	],
	[
		PACKAGE_PREFIX=
		PACKAGE_PREFIX_D=
	]
)
AC_SUBST(PACKAGE_PREFIX)
AC_SUBST(PACKAGE_PREFIX_D)
AC_DEFINE_UNQUOTED(PACKAGE_PREFIX, "$PACKAGE_PREFIX", "Package Prefix")

#######################################################################
# Set the location of the state dir
if test "x$localstatedir" != "x\${prefix}/var"; then
	tempDir=$localstatedir
else
	if test "x$prefix" != "xNONE"; then
		tempDir=${prefix}/var
	else
		tempDir=${ac_default_prefix}/var
	fi
fi
AC_DEFINE_UNQUOTED(DEFAULT_STATE_DIR, "${tempDir}", "Location of state dir")

#######################################################################
# Set the location of the lib dir
if test "x$libdir" != "x\${exec_prefix}/lib"; then
	tempDir=$libdir
else
	if test "x$exec_prefix" != "xNONE"; then
		tempDir=${exec_prefix}/lib
	else
		if test "x$prefix" != "xNONE"; then
			tempDir=${prefix}/lib
		else
			tempDir=${ac_default_prefix}/lib
		fi
	fi
fi
AC_DEFINE_UNQUOTED(DEFAULT_LIB_DIR, "${tempDir}", "Location of lib dir")


#######################################################################
# Set the location of the bin dir
if test "x$bindir" != "x\${exec_prefix}/bin"; then
	tempDir=$bindir
else
	if test "x$exec_prefix" != "xNONE"; then
		tempDir=${exec_prefix}/bin
	else
		if test "x$prefix" != "xNONE"; then
			tempDir=${prefix}/bin
		else
			tempDir=${ac_default_prefix}/bin
		fi
	fi
fi
AC_DEFINE_UNQUOTED(DEFAULT_BIN_DIR, "${tempDir}", "Location of bin dir")

#######################################################################
# Set the location of the sbin dir
if test "x$sbindir" != "x\${exec_prefix}/sbin"; then
	tempDir=$sbindir
else
	if test "x$exec_prefix" != "xNONE"; then
		tempDir=${exec_prefix}/sbin
	else
		if test "x$prefix" != "xNONE"; then
			tempDir=${prefix}/sbin
		else
			tempDir=${ac_default_prefix}/sbin
		fi
	fi
fi
AC_DEFINE_UNQUOTED(DEFAULT_SBIN_DIR, "${tempDir}", "Location of sbin dir")

#######################################################################
# Set the location of the libexec dir
if test "x$libexecdir" != "x\${exec_prefix}/libexec"; then
	tempDir=$libexecdir
else
	if test "x$exec_prefix" != "xNONE"; then
		tempDir=${exec_prefix}/libexec
	else
		if test "x$prefix" != "xNONE"; then
			tempDir=${prefix}/libexec
		else
			tempDir=${ac_default_prefix}/libexec
		fi
	fi
fi
AC_DEFINE_UNQUOTED(DEFAULT_LIBEXEC_DIR, "${tempDir}", "Location of libexec dir")

#####################################################
# Set the location of the sysconf dir
if test "x$sysconfdir" != "x\${prefix}/etc"; then
    tempDir=$sysconfdir
else
	if test "x$prefix" != "xNONE"; then
		tempDir=${prefix}/etc
	else
		tempDir=${ac_default_prefix}/etc
	fi
fi

AC_DEFINE_UNQUOTED(OMCCLP_SYSCONF_DIR, "${tempDir}", "Default sysconfig dir")

#######################################################################
PIDFILE_DIR="/var/run"
AC_SUBST(PIDFILE_DIR)
AC_DEFINE_UNQUOTED(PIDFILE_DIR, "${PIDFILE_DIR}", "PID file directory")

AC_OUTPUT(Makefile 
src/Makefile
src/clpaddrgram/Makefile
src/clpcmdgram/Makefile
)