Make warning CXXFLAGS configurable
This turns off -Werror by default except in the Debian package. -Werror is inherently unportable and breaks things on OS X. While it can cause problems in Debian too, this is at least a little better. It also turns off -pedantic in src/protobufs, because apparently protoc output doesn’t compile with -pedantic on all platforms. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
Keith Winstein
parent
8fa8bac35e
commit
aad760e7d6
@@ -12,6 +12,33 @@ AC_CONFIG_HEADERS([config.h])
|
|||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
|
|
||||||
|
WARNING_CXXFLAGS=""
|
||||||
|
PICKY_CXXFLAGS=""
|
||||||
|
AC_ARG_ENABLE([compile-warnings],
|
||||||
|
[AS_HELP_STRING([--enable-compile-warnings@<:@=no/yes/maximum/error],
|
||||||
|
[Turn on compiler warnings])],
|
||||||
|
[case "$enableval" in
|
||||||
|
no)
|
||||||
|
;;
|
||||||
|
'' | yes)
|
||||||
|
WARNING_CXXFLAGS="-Wall"
|
||||||
|
;;
|
||||||
|
maximum)
|
||||||
|
WARNING_CXXFLAGS="-Wall"
|
||||||
|
PICKY_CXXFLAGS="-Wextra -pedantic -Wno-long-long -Weffc++"
|
||||||
|
;;
|
||||||
|
error)
|
||||||
|
WARNING_CXXFLAGS="-Wall -Werror"
|
||||||
|
PICKY_CXXFLAGS="-Wextra -pedantic -Wno-long-long -Weffc++"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Unknown argument '$enableval' to --enable-compile-warnings])
|
||||||
|
;;
|
||||||
|
esac],
|
||||||
|
[WARNING_CXXFLAGS="-Wall"])
|
||||||
|
AC_SUBST([WARNING_CXXFLAGS])
|
||||||
|
AC_SUBST([PICKY_CXXFLAGS])
|
||||||
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
AC_SEARCH_LIBS([utempter_remove_added_record], [utempter], , [AC_MSG_ERROR([Unable to find libutempter.])])
|
AC_SEARCH_LIBS([utempter_remove_added_record], [utempter], , [AC_MSG_ERROR([Unable to find libutempter.])])
|
||||||
AC_SEARCH_LIBS([compress], [z], , [AC_MSG_ERROR([Unable to find zlib.])])
|
AC_SEARCH_LIBS([compress], [z], , [AC_MSG_ERROR([Unable to find zlib.])])
|
||||||
|
|||||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ Source: mosh
|
|||||||
Section: net
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Keith Winstein <keithw@mit.edu>
|
Maintainer: Keith Winstein <keithw@mit.edu>
|
||||||
Build-Depends: debhelper (>= 7.0.0), autotools-dev, protobuf-compiler, libprotobuf-dev, dh-autoreconf, pkg-config, libutempter-dev, libboost-dev, zlib1g-dev
|
Build-Depends: debhelper (>= 7.0.50), autotools-dev, protobuf-compiler, libprotobuf-dev, dh-autoreconf, pkg-config, libutempter-dev, libboost-dev, zlib1g-dev
|
||||||
Standards-Version: 3.9.3
|
Standards-Version: 3.9.3
|
||||||
Homepage: http://mosh.mit.edu
|
Homepage: http://mosh.mit.edu
|
||||||
Vcs-Git: git://github.com/keithw/mosh.git
|
Vcs-Git: git://github.com/keithw/mosh.git
|
||||||
|
|||||||
Vendored
+4
@@ -11,3 +11,7 @@
|
|||||||
|
|
||||||
%:
|
%:
|
||||||
dh $@ --with autoreconf
|
dh $@ --with autoreconf
|
||||||
|
|
||||||
|
override_dh_auto_configure:
|
||||||
|
dh_auto_configure -- \
|
||||||
|
--enable-compile-warnings=error
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -Weffc++ -fno-default-inline -pipe
|
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe
|
||||||
|
|
||||||
noinst_LIBRARIES = libmoshcrypto.a
|
noinst_LIBRARIES = libmoshcrypto.a
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -Weffc++ -fno-default-inline -pipe
|
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe
|
||||||
|
|
||||||
noinst_PROGRAMS = encrypt decrypt ntester parse termemu
|
noinst_PROGRAMS = encrypt decrypt ntester parse termemu
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
AM_CPPFLAGS = -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I$(builddir)/../protobufs -I$(srcdir)/../util
|
AM_CPPFLAGS = -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I$(builddir)/../protobufs -I$(srcdir)/../util
|
||||||
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -Weffc++ -fno-default-inline -pipe
|
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe
|
||||||
LIBS = $(protobuf_LIBS)
|
LIBS = $(protobuf_LIBS)
|
||||||
LDADD = ../crypto/libmoshcrypto.a ../network/libmoshnetwork.a ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../util/libmoshutil.a ../protobufs/libmoshprotos.a -lutil -lrt -lm -lutempter
|
LDADD = ../crypto/libmoshcrypto.a ../network/libmoshnetwork.a ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../util/libmoshutil.a ../protobufs/libmoshprotos.a -lutil -lrt -lm -lutempter
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
AM_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../crypto -I$(builddir)/../protobufs
|
AM_CPPFLAGS = -I$(srcdir)/../util -I$(srcdir)/../crypto -I$(builddir)/../protobufs
|
||||||
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -Weffc++ -fno-default-inline -pipe
|
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe
|
||||||
|
|
||||||
noinst_LIBRARIES = libmoshnetwork.a
|
noinst_LIBRARIES = libmoshnetwork.a
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ source = userinput.proto hostinput.proto transportinstruction.proto
|
|||||||
|
|
||||||
PROTOC = protoc
|
PROTOC = protoc
|
||||||
AM_CPPFLAGS = $(protobuf_CFLAGS)
|
AM_CPPFLAGS = $(protobuf_CFLAGS)
|
||||||
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -fno-default-inline -pipe
|
AM_CXXFLAGS = $(WARNING_CXXFLAGS) -fno-default-inline -pipe
|
||||||
|
|
||||||
SUFFIXES = .proto .pb.cc
|
SUFFIXES = .proto .pb.cc
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
AM_CPPFLAGS = -I$(srcdir)/../terminal -I$(builddir)/../protobufs
|
AM_CPPFLAGS = -I$(srcdir)/../terminal -I$(builddir)/../protobufs
|
||||||
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -Weffc++ -fno-default-inline -pipe
|
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe
|
||||||
|
|
||||||
noinst_LIBRARIES = libmoshstatesync.a
|
noinst_LIBRARIES = libmoshstatesync.a
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
AM_CPPFLAGS = -I$(srcdir)/../util
|
AM_CPPFLAGS = -I$(srcdir)/../util
|
||||||
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -Weffc++ -fno-default-inline -pipe
|
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe
|
||||||
|
|
||||||
noinst_LIBRARIES = libmoshterminal.a
|
noinst_LIBRARIES = libmoshterminal.a
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
AM_CXXFLAGS = -pedantic -Wno-long-long -Werror -Wall -Wextra -Weffc++ -fno-default-inline -pipe
|
AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe
|
||||||
|
|
||||||
noinst_LIBRARIES = libmoshutil.a
|
noinst_LIBRARIES = libmoshutil.a
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user