Skip to content

Commit

Permalink
media-gfx/openvdb: replace -isystem with -I for GCC 6 compatibility
Browse files Browse the repository at this point in the history
Gentoo-bug: 597866
* Respect CXX
* Respect ABI libdirs
* Remove '-O3' from compile lines

Signed-off by: Jonathan Scruggs ([email protected])
Closes: gentoo#2677

Signed-off-by: David Seifert <[email protected]>
  • Loading branch information
dracwyrm authored and SoapGentoo committed Oct 27, 2016
1 parent fe22cb8 commit f050483
Show file tree
Hide file tree
Showing 4 changed files with 276 additions and 136 deletions.
33 changes: 0 additions & 33 deletions media-gfx/openvdb/files/openvdb-3.2.0-build-fixes.patch

This file was deleted.

262 changes: 262 additions & 0 deletions media-gfx/openvdb/files/openvdb-3.2.0-fix-build-system.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
* Make build system honour the proper ABI library directory.
* Replace -isystem arguments with -I, as the former causes issues with GCC 6.
See also:
https://bugs.gentoo.org/show_bug.cgi?id=597866
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129

--- a/doxygen-config
+++ b/doxygen-config
@@ -2257,7 +2257,7 @@
# The default value is: png.
# This tag requires that the tag HAVE_DOT is set to YES.

-DOT_IMAGE_FORMAT = png
+DOT_IMAGE_FORMAT = svg

# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
--- a/Makefile
+++ b/Makefile
@@ -82,6 +82,7 @@

# The directory into which to install libraries, executables and header files
DESTDIR := /tmp/OpenVDB
+libdir = lib

# The parent directory of the boost/ header directory
BOOST_INCL_DIR := $(HT)/include
@@ -158,6 +159,9 @@
# The directory containing libpython
PYTHON_LIB_DIR := $(HFS)/python/lib
PYTHON_LIB := -lpython$(PYTHON_VERSION)
+# The Directory to install the python module and includes to.
+PYTHON_INSTALL_INCL_DIR := $(DESTDIR)/python/include/python$(PYTHON_VERSION)
+PYTHON_INSTALL_LIB_DIR := $(DESTDIR)/python/lib/python$(PYTHON_VERSION)
# The directory containing libboost_python
BOOST_PYTHON_LIB_DIR := /rel/depot/third_party_build/boost/rhel6-1.46.1-0/lib
BOOST_PYTHON_LIB := -lboost_python-gcc41-mt-python26-1_46_1
@@ -179,7 +183,6 @@
# (leave blank if Doxygen is unavailable)
DOXYGEN := doxygen

-
#
# Ideally, users shouldn't need to change anything below this line.
#
@@ -207,11 +210,7 @@
endif
endif

-ifeq (yes,$(strip $(debug)))
- OPTIMIZE := -g
-else
- OPTIMIZE := -O3 -DNDEBUG
-endif
+OPTIMIZE := -DNDEBUG

ifeq (yes,$(strip $(verbose)))
QUIET :=
@@ -242,12 +241,12 @@
has_python := yes
endif

-INCLDIRS := -I . -I .. -isystem $(BOOST_INCL_DIR) -isystem $(ILMBASE_INCL_DIR) -isystem $(TBB_INCL_DIR)
+INCLDIRS := -I. -I.. -I$(BOOST_INCL_DIR) -I$(ILMBASE_INCL_DIR) -I$(TBB_INCL_DIR)
ifeq (yes,$(has_blosc))
- INCLDIRS += -isystem $(BLOSC_INCL_DIR)
+ INCLDIRS += -I$(BLOSC_INCL_DIR)
endif
ifeq (yes,$(has_log4cplus))
- INCLDIRS += -isystem $(LOG4CPLUS_INCL_DIR)
+ INCLDIRS += -I$(LOG4CPLUS_INCL_DIR)
endif

CXXFLAGS += -std=c++0x
@@ -565,9 +564,9 @@
python/pyTransform.cc \
python/pyVec3Grid.cc \
#
-PYCXXFLAGS := -fPIC -isystem python -isystem $(PYTHON_INCL_DIR) -isystem $(PYCONFIG_INCL_DIR)
+PYCXXFLAGS := -fPIC -Ipython -I$(PYTHON_INCL_DIR) -I$(PYCONFIG_INCL_DIR)
ifneq (,$(strip $(NUMPY_INCL_DIR)))
-PYCXXFLAGS += -isystem $(NUMPY_INCL_DIR) -DPY_OPENVDB_USE_NUMPY
+PYCXXFLAGS += -I$(NUMPY_INCL_DIR) -DPY_OPENVDB_USE_NUMPY
endif
ifneq (no,$(strip $(PYTHON_WRAP_ALL_GRID_TYPES)))
PYCXXFLAGS += -DPY_OPENVDB_WRAP_ALL_GRID_TYPES
@@ -678,7 +677,7 @@
@echo "Building $@ because of $(call list_deps)"
$(CXX) -c $(CXXFLAGS) -fPIC -o $@ $<

-all: lib python vdb_print vdb_render vdb_test depend
+all: lib python vdb_print vdb_render vdb_view vdb_test depend

$(OBJ_NAMES): %.o: %.cc
@echo "Building $@ because of $(call list_deps)"
@@ -719,8 +718,13 @@
@echo "Generating documentation because of $(list_deps)"
echo -e 'OUTPUT_DIRECTORY=./doc\nGENERATE_LATEX=YES\nGENERATE_HTML=NO' \
| cat doxygen-config - | $(DOXYGEN) - $(QUIET) \
- && cd ./doc/latex && make refman.pdf $(QUIET) \
+ && cd ./doc/latex && $(MAKE) refman.pdf $(QUIET) \
&& echo 'Created doc/latex/refman.pdf'
+ @#
+ mkdir -p $(DESTDIR)/share/doc/openvdb/pdf; \
+ echo "Created $(DESTDIR)/share/doc/openvdb/pdf"; \
+ cp -r -f doc/latex/refman.pdf $(DESTDIR)/share/doc/openvdb/pdf/; \
+ echo "Copied documentation to $(DESTDIR)/share/doc/openvdb/pdf/"; \

ifneq (,$(strip $(DOXYGEN)))
doc: $(DOC_INDEX)
@@ -734,14 +738,14 @@

vdb_print: $(LIBOPENVDB) cmd/openvdb_print/main.cc
@echo "Building $@ because of $(list_deps)"
- $(CXX) $(CXXFLAGS) -o $@ cmd/openvdb_print/main.cc -I . \
+ $(CXX) $(CXXFLAGS) -o $@ cmd/openvdb_print/main.cc -I. \
$(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
$(LIBS_RPATH) $(CONCURRENT_MALLOC_LIB)

vdb_render: $(LIBOPENVDB) cmd/openvdb_render/main.cc
@echo "Building $@ because of $(list_deps)"
- $(CXX) $(CXXFLAGS) -o $@ cmd/openvdb_render/main.cc -I . \
- -isystem $(EXR_INCL_DIR) -isystem $(ILMBASE_INCL_DIR) \
+ $(CXX) $(CXXFLAGS) -o $@ cmd/openvdb_render/main.cc -I. \
+ -I$(EXR_INCL_DIR) -I$(ILMBASE_INCL_DIR) \
-Wl,-rpath,$(EXR_LIB_DIR) -L$(EXR_LIB_DIR) $(EXR_LIB) \
-Wl,-rpath,$(ILMBASE_LIB_DIR) -L$(ILMBASE_LIB_DIR) $(ILMBASE_LIB) \
$(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
@@ -761,12 +765,12 @@
$(LIBVIEWER_OBJ_NAMES): $(LIBVIEWER_INCLUDE_NAMES)
$(LIBVIEWER_OBJ_NAMES): %.o: %.cc
@echo "Building $@ because of $(list_deps)"
- $(CXX) -c $(CXXFLAGS) -I . -isystem $(GLFW_INCL_DIR) -DGL_GLEXT_PROTOTYPES=1 -fPIC -o $@ $<
+ $(CXX) -c $(CXXFLAGS) -I. -I$(GLFW_INCL_DIR) -DGL_GLEXT_PROTOTYPES=1 -fPIC -o $@ $<

vdb_view: $(LIBOPENVDB) $(LIBVIEWER_OBJ_NAMES) cmd/openvdb_view/main.cc
@echo "Building $@ because of $(list_deps)"
$(CXX) $(CXXFLAGS) -o $@ cmd/openvdb_view/main.cc $(LIBVIEWER_OBJ_NAMES) \
- -I . -Wl,-rpath,$(GLFW_LIB_DIR) -L$(GLFW_LIB_DIR) $(GLFW_LIB) \
+ -I. -Wl,-rpath,$(GLFW_LIB_DIR) -L$(GLFW_LIB_DIR) $(GLFW_LIB) \
$(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
$(LIBVIEWER_FLAGS) $(LIBS_RPATH) $(BOOST_THREAD_LIB) $(CONCURRENT_MALLOC_LIB)
endif
@@ -776,7 +780,7 @@
$(PYTHON_OBJ_NAMES): $(PYTHON_INCLUDE_NAMES)
$(PYTHON_OBJ_NAMES): %.o: %.cc
@echo "Building $@ because of $(list_deps)"
- $(CXX) -c $(CXXFLAGS) -I . $(PYCXXFLAGS) -o $@ $<
+ $(CXX) -c $(CXXFLAGS) -I. $(PYCXXFLAGS) -o $@ $<
$(PYTHON_MODULE): $(LIBOPENVDB) $(PYTHON_OBJ_NAMES)
@echo "Building $@ because of $(list_deps)"
$(CXX) $(CXXFLAGS) $(PYCXXFLAGS) -shared $(PYTHON_SONAME_FLAGS) -o $@ $(PYTHON_OBJ_NAMES) \
@@ -784,6 +788,22 @@
-Wl,-rpath,$(BOOST_PYTHON_LIB_DIR) -L$(BOOST_PYTHON_LIB_DIR) $(BOOST_PYTHON_LIB) \
$(LIBOPENVDB_RPATH) -L$(CURDIR) $(LIBOPENVDB) \
$(LIBS_RPATH) $(CONCURRENT_MALLOC_LIB)
+ @echo "Installing the python module and includes"
+ @#
+ mkdir -p $(PYTHON_INSTALL_INCL_DIR); \
+ echo "Created $(PYTHON_INSTALL_INCL_DIR)"; \
+ cp -f $(PYTHON_PUBLIC_INCLUDE_NAMES) $(PYTHON_INSTALL_INCL_DIR)/; \
+ echo "Copied Python header files to $(PYTHON_INSTALL_INCL_DIR)"; \
+ mkdir -p $(PYTHON_INSTALL_LIB_DIR); \
+ echo "Created $(PYTHON_INSTALL_LIB_DIR)"; \
+ cp -f $(PYTHON_MODULE) $(PYTHON_INSTALL_LIB_DIR)/; \
+ pushd $(PYTHON_INSTALL_LIB_DIR) > /dev/null; \
+ ln -f -s $(PYTHON_MODULE) $(PYTHON_SONAME); \
+ popd > /dev/null; \
+ echo "Copied Python module to $(PYTHON_INSTALL_LIB_DIR)"
+ @echo "Clean the Python modules so the next one will compile"
+ @#
+ $(RM) $(PYTHON_OBJ_NAMES)

ifeq (yes,$(has_python))
ifneq (,$(strip $(EPYDOC)))
@@ -794,7 +814,7 @@
echo "Created $${pydocdir}"; \
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$(CURDIR); \
export PYTHONPATH=${PYTHONPATH}:$(CURDIR); \
- $(EPYDOC) --html -o $${pydocdir} $(PYTHON_MODULE_NAME) $(QUIET)
+ $(EPYDOC) --html --html-dir $${pydocdir} $(PYTHON_MODULE_NAME) $(QUIET)
else
pydoc:
@echo "$@"': $$EPYDOC is undefined'
@@ -815,7 +835,7 @@

$(UNITTEST_OBJ_NAMES): %.o: %.cc
@echo "Building $@ because of $(list_deps)"
- $(CXX) -c $(CXXFLAGS) -isystem $(CPPUNIT_INCL_DIR) -fPIC -o $@ $<
+ $(CXX) -c $(CXXFLAGS) -I$(CPPUNIT_INCL_DIR) -fPIC -o $@ $<

ifneq (,$(strip $(CPPUNIT_INCL_DIR)))
vdb_test: $(LIBOPENVDB) $(UNITTEST_OBJ_NAMES)
@@ -835,7 +855,7 @@
@echo "$@"': $$(CPPUNIT_INCL_DIR) is undefined'
endif

-install: lib python vdb_print vdb_render vdb_view doc pydoc
+install: lib vdb_print vdb_render vdb_view doc pydoc
mkdir -p $(DESTDIR)/include/openvdb
@echo "Created $(DESTDIR)/include/openvdb"
pushd $(DESTDIR)/include/openvdb > /dev/null; \
@@ -851,42 +871,25 @@
fi
@echo "Copied header files to $(DESTDIR)/include"
@#
- mkdir -p $(DESTDIR)/lib
- @echo "Created $(DESTDIR)/lib/"
- cp -f $(LIBOPENVDB) $(DESTDIR)/lib
- pushd $(DESTDIR)/lib > /dev/null; \
+ mkdir -p $(DESTDIR)/$(libdir)
+ @echo "Created $(DESTDIR)/$(libdir)/"
+ cp -f $(LIBOPENVDB) $(DESTDIR)/$(libdir)
+ pushd $(DESTDIR)/$(libdir) > /dev/null; \
if [ -f $(LIBOPENVDB_SHARED) ]; then \
ln -f -s $(LIBOPENVDB_SHARED) $(LIBOPENVDB_SHARED_NAME); \
ln -f -s $(LIBOPENVDB_SHARED) $(LIBOPENVDB_SONAME); \
fi; \
popd > /dev/null
- @echo "Copied libopenvdb to $(DESTDIR)/lib/"
+ @echo "Copied libopenvdb to $(DESTDIR)/$(libdir)/"
@#
if [ -f $(LIBVIEWER) ]; \
then \
- cp -f $(LIBVIEWER) $(DESTDIR)/lib; \
- pushd $(DESTDIR)/lib > /dev/null; \
+ cp -f $(LIBVIEWER) $(DESTDIR)/$(libdir); \
+ pushd $(DESTDIR)/$(libdir) > /dev/null; \
if [ -f $(LIBVIEWER_SHARED) ]; then \
ln -f -s $(LIBVIEWER_SHARED) $(LIBVIEWER_SHARED_NAME); fi; \
popd > /dev/null; \
- echo "Copied libopenvdb_viewer to $(DESTDIR)/lib/"; \
- fi
- @#
- if [ -f $(PYTHON_MODULE) ]; \
- then \
- installdir=$(DESTDIR)/python/include/python$(PYTHON_VERSION); \
- mkdir -p $${installdir}; \
- echo "Created $${installdir}"; \
- cp -f $(PYTHON_PUBLIC_INCLUDE_NAMES) $${installdir}/; \
- echo "Copied Python header files to $${installdir}"; \
- installdir=$(DESTDIR)/python/lib/python$(PYTHON_VERSION); \
- mkdir -p $${installdir}; \
- echo "Created $${installdir}"; \
- cp -f $(PYTHON_MODULE) $${installdir}/; \
- pushd $${installdir} > /dev/null; \
- ln -f -s $(PYTHON_MODULE) $(PYTHON_SONAME); \
- popd > /dev/null; \
- echo "Copied Python module to $${installdir}"; \
+ echo "Copied libopenvdb_viewer to $(DESTDIR)/$(libdir)/"; \
fi
@#
mkdir -p $(DESTDIR)/bin
@@ -924,7 +927,7 @@
for f in $(UNITTEST_SRC_NAMES); \
do $(CXX) $(CXXFLAGS) -O0 \
-MM $$f -MT `echo $$f | sed 's%\.[^.]*%.o%'` \
- -isystem $(CPPUNIT_INCL_DIR) >> $(DEPEND); \
+ -I$(CPPUNIT_INCL_DIR) >> $(DEPEND); \
done; \
fi

93 changes: 0 additions & 93 deletions media-gfx/openvdb/files/openvdb-3.2.0-makefile-fixes.patch

This file was deleted.

Loading

0 comments on commit f050483

Please sign in to comment.