Browse Source

Simplify AM_CPPFLAGS include setup

We had accumulated a bunch of cruft here.  Now let's only include
src and src/ext.  (exception: src/trunnel is autogenerated code, and
need to include src/trunnel.)

This commit will break the build hard.  The next commit will fix it.
Nick Mathewson 5 years ago
parent
commit
257b280776
7 changed files with 12 additions and 30 deletions
  1. 5 1
      Makefile.am
  2. 0 10
      configure.ac
  3. 0 4
      src/common/include.am
  4. 0 1
      src/or/include.am
  5. 5 7
      src/test/include.am
  6. 0 3
      src/trace/include.am
  7. 2 4
      src/trunnel/include.am

+ 5 - 1
Makefile.am

@@ -15,7 +15,11 @@ TESTS=
 noinst_PROGRAMS=
 DISTCLEANFILES=
 bin_SCRIPTS=
-AM_CPPFLAGS=
+AM_CPPFLAGS=\
+	-I$(top_srcdir)/src \
+	-I$(top_srcdir)/src/ext \
+	-I$(top_srcdir)/src/ext/trunnel
+
 AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@ @TOR_LZMA_CFLAGS@ @TOR_ZSTD_CFLAGS@
 SHELL=@SHELL@
 

+ 0 - 10
configure.ac

@@ -21,16 +21,6 @@ AC_CANONICAL_HOST
 
 PKG_PROG_PKG_CONFIG
 
-if test -f "/etc/redhat-release"; then
-  if test -f "/usr/kerberos/include"; then
-    CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
-  fi
-fi
-
-# Not a no-op; we want to make sure that CPPFLAGS is set before we use
-# the += operator on it in src/or/Makefile.am
-CPPFLAGS="$CPPFLAGS -I\${top_srcdir}/src/common"
-
 AC_ARG_ENABLE(openbsd-malloc,
    AS_HELP_STRING(--enable-openbsd-malloc, [use malloc code from OpenBSD.  Linux only]))
 AC_ARG_ENABLE(static-openssl,

+ 0 - 4
src/common/include.am

@@ -15,9 +15,6 @@ endif
 
 EXTRA_DIST += src/common/Makefile.nmake
 
-#CFLAGS  = -Wall -Wpointer-arith -O2
-AM_CPPFLAGS += -I$(srcdir)/src/common -Isrc/common -I$(srcdir)/src/ext/trunnel -I$(srcdir)/src/trunnel
-
 if USE_OPENBSD_MALLOC
 libor_extra_source=src/ext/OpenBSD_malloc_Linux.c
 else
@@ -214,4 +211,3 @@ COMMONHEADERS = \
   src/common/workqueue.h
 
 noinst_HEADERS+= $(COMMONHEADERS)
-

+ 0 - 1
src/or/include.am

@@ -142,7 +142,6 @@ src_or_libtor_testing_a_SOURCES =
 endif
 
 src_or_tor_SOURCES = src/or/tor_main.c
-AM_CPPFLAGS += -I$(srcdir)/src/or -Isrc/or
 
 src/or/tor_main.$(OBJEXT) \
   src/or/src_or_tor_cov-tor_main.$(OBJEXT): micro-revision.i

+ 5 - 7
src/test/include.am

@@ -71,10 +71,8 @@ endif
 src_test_AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \
         -DLOCALSTATEDIR="\"$(localstatedir)\"" \
         -DBINDIR="\"$(bindir)\""	       \
-	-I"$(top_srcdir)/src/or" -I"$(top_srcdir)/src/ext" \
-	-I"$(top_srcdir)/src/trunnel" \
-	-I"$(top_srcdir)/src/ext/trunnel" \
-	-DTOR_UNIT_TESTS
+	-DTOR_UNIT_TESTS                       \
+	$(AM_CPPFLAGS)
 
 # -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
 # This seems to matter nowhere but on Windows, but I assure you that it
@@ -327,7 +325,7 @@ src_test_test_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \
 	@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@ \
 	@CURVE25519_LIBS@ @TOR_LZMA_LIBS@
 src_test_test_ntor_cl_AM_CPPFLAGS =	       \
-	-I"$(top_srcdir)/src/or"
+	$(AM_CPPFLAGS)
 
 src_test_test_hs_ntor_cl_SOURCES  = src/test/test_hs_ntor_cl.c
 src_test_test_hs_ntor_cl_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
@@ -337,7 +335,7 @@ src_test_test_hs_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \
 	@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
 	@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
 src_test_test_hs_ntor_cl_AM_CPPFLAGS =	       \
-	-I"$(top_srcdir)/src/or"
+	$(AM_CPPFLAGS)
 
 
 noinst_PROGRAMS += src/test/test-bt-cl
@@ -347,7 +345,7 @@ src_test_test_bt_cl_LDADD = src/common/libor-testing.a \
 	src/trace/libor-trace.a \
 	$(rust_ldadd) \
 	@TOR_LIB_MATH@ \
-	@TOR_LIB_WS32@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@ 
+	@TOR_LIB_WS32@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@
 src_test_test_bt_cl_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
 src_test_test_bt_cl_CPPFLAGS= $(src_test_AM_CPPFLAGS) $(TEST_CPPFLAGS)
 

+ 0 - 3
src/trace/include.am

@@ -1,6 +1,3 @@
-# Include the src/ so we can use the trace/events.h statement when including
-# any file in that directory.
-AM_CPPFLAGS += -I$(srcdir)/src
 
 noinst_LIBRARIES += \
 	src/trace/libor-trace.a

+ 2 - 4
src/trunnel/include.am

@@ -6,8 +6,6 @@ noinst_LIBRARIES += \
 	src/trunnel/libor-trunnel-testing.a
 endif
 
-AM_CPPFLAGS += -I$(srcdir)/src/ext/trunnel -I$(srcdir)/src/trunnel
-
 TRUNNELINPUTS = \
 	src/trunnel/ed25519_cert.trunnel \
 	src/trunnel/link_handshake.trunnel \
@@ -39,7 +37,8 @@ TRUNNELHEADERS = \
 	src/trunnel/channelpadding_negotiation.h
 
 src_trunnel_libor_trunnel_a_SOURCES = $(TRUNNELSOURCES)
-src_trunnel_libor_trunnel_a_CPPFLAGS = -DTRUNNEL_LOCAL_H $(AM_CPPFLAGS)
+src_trunnel_libor_trunnel_a_CPPFLAGS = \
+	-DTRUNNEL_LOCAL_H $(AM_CPPFLAGS) -I$(top_srcdir)/src/trunnel
 
 if UNITTESTS_ENABLED
 src_trunnel_libor_trunnel_testing_a_SOURCES = $(TRUNNELSOURCES)
@@ -54,4 +53,3 @@ noinst_HEADERS+= $(TRUNNELHEADERS)
 
 EXTRA_DIST += \
 	src/trunnel/README
-