SourceForge has been redesigned. Learn more.
Close

[45438a]: / configure.in  Maximize  Restore  History

Download this file

107 lines (88 with data), 3.5 kB

#
# configure.in for the trousers project
#

AC_INIT(trousers, 0.1.3, trousers-tech@lists.sf.net)
# Require the tested version
AM_INIT_AUTOMAKE(1.6.3)

# Debugging support
AC_ARG_ENABLE(debug,
		AC_HELP_STRING([--enable-debug], [turn on all trousers debugging flags [default is off]]),
		[enable_debug="yes"
		 AC_MSG_RESULT([*** Enabling debugging at user request ***])],)

# If the user has not set CFLAGS, do something appropriate
test_CFLAGS=${CFLAGS+set}
if test "$test_CFLAGS" != set; then
	if test "x$enable_debug" == "xyes"; then
		CFLAGS="-O0 -g -DTSS_DEBUG"
#		CFLAGS="-O0 -g -DTSS_DEBUG -DTCSD_SINGLE_THREAD_DEBUG"
	else
		CFLAGS="-O2"
	fi
fi

# The tspi Makefile will look for crypto/@CRYPTO_PACKAGE@/crypto.c
# Future crypto packages can go in their own subdir of tspi/crypto
# and a check for them should be made here
AC_CHECK_LIB([crypto], [EVP_DigestUpdate],
		[CRYPTO_PACKAGE='openssl'],
		[AC_MSG_ERROR([openssl is currently the only supported crypto library for trousers. Please install openssl from http://www.openssl.org or the -devel package from your distro])])
AC_SUBST([CRYPTO_PACKAGE])

# profiling support
AC_ARG_ENABLE(gprof,
		AC_HELP_STRING([--enable-gprof], [enable profiling with gprof [default=off]]),
		[CFLAGS="$CFLAGS -pg"
		 AC_MSG_RESULT([*** Enabling profiling at user request ***])],)

AC_ARG_ENABLE(efence,
		AC_HELP_STRING([--enable-efence], [turn on electric fence malloc debugger [default=off]]),
		[LDFLAGS="$LDFLAGS -lefence"
		 AC_MSG_RESULT([*** Enabling electric fence at user request ***])],)

AC_ARG_ENABLE(gcov,
		AC_HELP_STRING([--enable-gcov], [turn on gcov code coverage flags [default=off]]),
		[CFLAGS="$CFLAGS -ftest-coverage -fprofile-arcs"
		 AC_MSG_RESULT([*** Enabling gcov at user request ***])],)

AC_ARG_ENABLE(stderrlog,
		AC_HELP_STRING([--enable-stderrlog], [log messages to stderr instead of syslog [default=off]]),
		[CFLAGS="$CFLAGS -DTSS_LOG_STDERR"
		 AC_MSG_RESULT([*** Enabling logging to stderr at user request ***])],)

# section imported from Glade compile
pkg_modules="gtk+-2.0 >= 2.0.0"
PKG_CHECK_MODULES(GTK, [$pkg_modules], AM_CONDITIONAL(HAVE_GTK, true),AC_MSG_RESULT([You are probably missing package gtk2-devel])])
#AC_SUBST(GTK_CFLAGS)
#AC_SUBST(GTK_LIBS)

#GETTEXT_PACKAGE=trousers
#AC_SUBST(GETTEXT_PACKAGE)
#AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")

dnl Add the languages which your application supports here.
#ALL_LINGUAS=""
#AM_GLIB_GNU_GETTEXT

# end Glade section

AC_DISABLE_STATIC
AC_PROG_CC
AC_PROG_LIBTOOL


CFLAGS="$CFLAGS -I../include -W -Wall"
#CFLAGS="$CFLAGS -I../include -std=c99 -pedantic -W -Wall"
KERNEL_VERSION=`uname -r`
AC_SUBST(CFLAGS)

# When we build the rpms, prefix will be /usr. This'll do some things that make sense,
# like put our sbin stuff in /usr/sbin and our library in /usr/lib. It'll do some other
# things that don't make sense like put our config file in /usr/etc. So, I'll just hack
# it here. If the --prefix option isn't specified during configure, let it all go to
# /usr/local, even /usr/local/etc. :-P
if test x"${prefix}" == x"/usr"; then
	sysconfdir="/etc"
	localstatedir="/var"
	mandir="/usr/share/man"
elif test x"${prefix}" == x"NONE"; then
	localstatedir="/usr/local/var"
fi

AC_OUTPUT(dist/tcsd.conf \
	  dist/trousers.spec \
	  Makefile \
	  src/Makefile \
	  src/include/Makefile \
	  src/tcs/Makefile \
	  src/tddl/Makefile \
	  src/tspi/Makefile \
	  src/tcsd/Makefile \
	  dist/Makefile \
	  man/Makefile \
	  man/man3/Makefile)