diff --git a/configure.in b/configure.in index a626457..e8baa51 100644 --- a/configure.in +++ b/configure.in @@ -364,6 +364,22 @@ if test "x$USE_OPT" = "xyes"; then fi AC_SUBST(OPT_CFLAGS) +dnl ----------------- +dnl Compiler warnings +dnl ----------------- + +WARN_CFLAGS="" +dnl USE_WARN="" +AC_MSG_CHECKING(whether to enable compiler warnings) +AC_ARG_ENABLE(warn, + [ --disable-warn disable compiler warnings ], + AC_MSG_RESULT(no), + AC_MSG_RESULT(yes) + dnl USE_WARN="yes" + WARN_CFLAGS="$WARN_CFLAGS -Wall -Werror" +) +AC_SUBST(WARN_CFLAGS) + dnl ------------------- dnl Checks for asm junk dnl ------------------- diff --git a/src/Makefile.am b/src/Makefile.am index b9b1bb3..edc1c83 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ SUBDIRS = . baseq2 ctf xatrix rogue -std_cflags = -Wall -Werror -pipe @OPT_CFLAGS@ +std_cflags = -pipe @WARN_CFLAGS@ @OPT_CFLAGS@ module_ldflags = -module -avoid-version -rpath $(pkglibdir) bin_PROGRAMS = quake2 diff --git a/src/baseq2/Makefile.am b/src/baseq2/Makefile.am index 4d4ba45..6e22449 100644 --- a/src/baseq2/Makefile.am +++ b/src/baseq2/Makefile.am @@ -23,6 +23,6 @@ noinst_HEADERS = g_local.h m_actor.h m_berserk.h m_boss2.h m_boss31.h \ m_rider.h m_soldier.h m_supertank.h m_tank.h -AM_CFLAGS = -fPIC -Wall -Werror -pipe @OPT_CFLAGS@ +AM_CFLAGS = -fPIC -pipe @WARN_CFLAGS@ @OPT_CFLAGS@ AM_CPPFLAGS = -I$(top_srcdir)/src LDFLAGS = -module -avoid-version -rpath $(pkglibdir) diff --git a/src/ctf/Makefile.am b/src/ctf/Makefile.am index 2d0ad89..7ad1f15 100644 --- a/src/ctf/Makefile.am +++ b/src/ctf/Makefile.am @@ -13,6 +13,6 @@ game_la_SOURCES = g_ai.c g_chase.c g_cmds.c g_combat.c g_ctf.c \ noinst_HEADERS = g_ctf.h g_local.h m_player.h p_menu.h -AM_CFLAGS = -fPIC -Wall -Werror -pipe @OPT_CFLAGS@ +AM_CFLAGS = -fPIC -pipe @WARN_CFLAGS@ @OPT_CFLAGS@ AM_CPPFLAGS = -I$(top_srcdir)/src LDFLAGS = -module -avoid-version -rpath $(pkglibdir)