207 lines (186 with data), 5.7 kB
AC_INIT(src/omcclp.cpp)
AC_CONFIG_AUX_DIR(config)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(omcclp, 0.5)
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=""
#######################################################################
# 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)])
DEBUG_FLAGS="-DDEBUG -g -O0" # Additional debugging flags.
OPT_FLAGS=" -DNDEBUG -O2" # Additional optimization flags.
#######################################################################
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
)