changeset 22124:64f82a8b46e1

config.h: install a stub replacement with a deprecation warning (bug #41027) * Makefile.am (nodist_octinclude_HEADERS): Remove autoconf-generated config.h from the list of header files to install. * deprecated-config.h: New file to replace config.h in the public API. Use a different name to not shadow config.h during the build. * libinterp/module.mk (install-deprecated-config-h, uninstall-deprecated-config-h): New targets to install and uninstall it.
author Mike Miller <mtmiller@octave.org>
date Fri, 15 Jul 2016 15:15:13 -0700
parents 46ce9eb019a6
children ad1790bb8f71
files Makefile.am libinterp/deprecated-config.h libinterp/module.mk
diffstat 3 files changed, 41 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Thu Apr 21 21:13:24 2016 +0200
+++ b/Makefile.am	Fri Jul 15 15:15:13 2016 -0700
@@ -310,7 +310,6 @@
 CONFIG_FILES = @ac_config_headers@ @ac_config_files@
 
 nodist_octinclude_HEADERS += \
-  config.h \
   oct-conf-post.h \
   octave-config.h
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libinterp/deprecated-config.h	Fri Jul 15 15:15:13 2016 -0700
@@ -0,0 +1,30 @@
+/*
+
+Copyright (C) 2016 Mike Miller
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#if ! defined (octave_config_h)
+#define octave_config_h 1
+
+#include "octave-config.h"
+
+#warning "config.h has been deprecated; there is no need to include it directly"
+
+#endif
--- a/libinterp/module.mk	Thu Apr 21 21:13:24 2016 +0200
+++ b/libinterp/module.mk	Fri Jul 15 15:15:13 2016 -0700
@@ -288,9 +288,9 @@
 
 DIRSTAMP_FILES += libinterp/$(octave_dirstamp)
 
-install-data-hook: install-oct install-built-in-docstrings
+install-data-hook: install-oct install-built-in-docstrings install-deprecated-config-h
 
-uninstall-local: uninstall-oct uninstall-built-in-docstrings
+uninstall-local: uninstall-oct uninstall-built-in-docstrings uninstall-deprecated-config-h
 
 if AMCOND_ENABLE_DYNAMIC_LINKING
 install-oct:
@@ -333,6 +333,15 @@
 	rm -f $(DESTDIR)$(octetcdir)/built-in-docstrings
 .PHONY: uninstall-built-in-docstrings
 
+install-deprecated-config-h: libinterp/deprecated-config.h
+	$(MKDIR_P) $(DESTDIR)$(octincludedir)
+	$(INSTALL_DATA) $< $(DESTDIR)$(octincludedir)/config.h
+.PHONY: install-deprecated-config-h
+
+uninstall-deprecated-config-h:
+	rm -f $(DESTDIR)$(octincludedir)/config.h
+.PHONY: uninstall-deprecated-config-h
+
 EXTRA_DIST += $(libinterp_EXTRA_DIST)
 
 libinterp_CLEANFILES += \