Добавлена опция --enable-debug=yes,no для configure (по умолчанию no)

This commit is contained in:
Kernell 2015-12-19 23:53:58 +03:00
parent 1970206eeb
commit e0bb300872
4 changed files with 39 additions and 10 deletions

View File

@ -3,7 +3,42 @@
AC_PREREQ([2.69])
AC_INIT(mta-mono, 0.25a, kernell.it@gmail.com)
AM_INIT_AUTOMAKE([-Wall -Wno-conversion-null -Werror foreign])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],
[enable debugging, default: no]),
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],
[debug=false])
AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
# prevent setting xFLAGS to default of -g -O2
if test x"$CFLAGS" = x""; then
AC_SUBST(CFLAGS, [ ])
fi
if test x"$CXXFLAGS" = x""; then
AC_SUBST(CXXFLAGS, [ ])
fi
AC_ARG_ENABLE([debug],
AC_HELP_STRING([--enable-debug],
[compile with debug symbols @<:@default=no@:>@]),
[want_debug="$enableval"], [want_debug=no])
if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
CFLAGS="$CFLAGS -std=c++0x -pipe -Wall -O0 -ggdb"
CXXFLAGS="$CXXFLAGS -std=c++0x -pipe -Wall -O0 -ggdb"
AC_DEFINE([DEBUG], 1, [Define for debugging])
else
CFLAGS="$CFLAGS -std=c++0x -pipe -Wall -O2 -DNDEBUG -D_FORTIFY_SOURCE=2 -fPIC -MD"
CXXFLAGS="$CXXFLAGS -std=c++0x -pipe -Wall -O2 -DNDEBUG -D_FORTIFY_SOURCE=2 -fPIC -MD"
fi
AC_CONFIG_FILES([Makefile src/Makefile src/extra/Makefile src/lua/Makefile])
AM_PROG_AR

View File

@ -1,4 +1,4 @@
AM_CPPFLAGS=-std=c++0x -pipe -I. -I./include -I../vendor/lua51/src -I../vendor/eglib/src
AM_CPPFLAGS=-I. -I./include -I../vendor/lua51/src -I../vendor/eglib/src
SUBDIRS = extra lua
@ -45,5 +45,3 @@ libmta_mono_la_SOURCES = \
StdInc.cpp
libmta_mono_la_LIBADD = -lstdc++ -lm -llua_f_defs -lmta_mono_extra -llua -leglib -lmonoboehm-2.0 -L./lua -L./extra -L../lib -L../vendor/lua51/src
libmta_mono_la_CFLAGS = $(AM_CFLAGS)

View File

@ -1,4 +1,4 @@
AM_CPPFLAGS=-std=c++0x -pipe -I. -I.. -I../include -I../../vendor/eglib/src -I../../vendor/lua51/src
AM_CPPFLAGS=-I. -I.. -I../include -I../../vendor/eglib/src -I../../vendor/lua51/src
noinst_LIBRARIES=libmta_mono_extra.a
@ -7,5 +7,3 @@ libmta_mono_extra_a_SOURCES = \
CLuaArguments.cpp \
Vector2.cpp \
Vector3.cpp
libmta_mono_extra_a_CFLAGS = $(AM_CFLAGS)

View File

@ -1,7 +1,5 @@
AM_CPPFLAGS=-std=c++0x -pipe -I. -I.. -I../include -I../../vendor/eglib/src -I../../vendor/lua51/src
AM_CPPFLAGS=-I. -I.. -I../include -I../../vendor/eglib/src -I../../vendor/lua51/src
noinst_LIBRARIES = liblua_f_defs.a
liblua_f_defs_a_SOURCES = CLuaFunctionDefinitions.cpp
liblua_f_defs_a_CFLAGS = $(AM_CFLAGS)