This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[c++] g++ includes, library bits



Consolidates the g++ include dir bits. Matches the pending compiler patch.

-benjamin


2001-02-05  Benjamin Kosnik  <bkoz@redhat.com>

	* acinclude.m4 (GLIBCPP_EXPORT_INSTALL_INFO): New
	macro. Consolidate all the bits to do with where includes might be
	installed.
	* aclocal.m4: Regenerate.
	* configure.in: Use it.
	* configure: Regenerate.	
	* src/Makefile.am (targetincludep): Use simplified rules.
	(targetincludep): Rename gxx_target_include_dir.
	(myincludep): Rename gxx_include_dir.
	* src/Makefile.in: Regenerate.
	* libsupc++/Makefile.am: Use simplified rules.
	* libsupc++/Makefile.in: Regenerate.

Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/acinclude.m4,v
retrieving revision 1.125
diff -c -p -r1.125 acinclude.m4
*** acinclude.m4	2001/02/01 21:08:03	1.125
--- acinclude.m4	2001/02/06 05:47:38
*************** AC_DEFUN(GLIBCPP_EXPORT_FLAGS, [
*** 1490,1495 ****
--- 1490,1553 ----
  ])
  
  
+ dnl  GLIBCPP_EXPORT_INSTALL_INFO
+ dnl  calculates gxx_install_dir
+ dnl
+ AC_DEFUN(GLIBCPP_EXPORT_INSTALL_INFO, [
+ 
+ AC_MSG_CHECKING([for interface version number])
+ libstdcxx_interface=$INTERFACE
+ AC_MSG_RESULT($libstdcxx_interface)
+ 
+ # Process the option --with-gxx-include-dir=<path to include-files directory>
+ AC_MSG_CHECKING([for --with-gxx-include-dir])
+ AC_ARG_WITH(gxx-include-dir,
+ [ --with-gxx-include-dir  the installation directory for include files],
+ [case "${withval}" in
+   yes)
+     AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
+     gxx_include_dir=no
+     ;;
+   no)
+     gxx_include_dir=no
+     ;;
+   *)
+     gxx_include_dir=${withval}
+     ;;
+ esac], [gxx_include_dir=no])
+ AC_MSG_RESULT($gxx_include_dir)
+ 
+ # Process the option "--enable-version-specific-runtime-libs"
+ AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
+ AC_ARG_ENABLE(version-specific-runtime-libs,
+ [  --enable-version-specific-runtime-libs    Specify that runtime libraries should be installed in a compiler-specific directory ],
+ [  version_specific_libs=yes
+ # Need the gcc compiler version to know where to install libraries
+ # and header files if --enable-version-specific-runtime-libs option
+ # is selected.
+ changequote(,)dnl
+ gcc_tmp=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $6}'`
+ gcc_num=`echo ${gcc_tmp} | sed 's/\"//g'`
+ #gcc_date=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $7}'`
+ #gcc_version=$gcc_num-$gcc_date
+ gcc_version=$gcc_num
+ gxx_include_dir=$(libdir)/gcc-lib/$(target_alias)/$(gcc_version)/include/g++
+ changequote([,])dnl
+ AC_SUBST(gcc_version)
+ AM_CONDITIONAL(VERSION_SPECIFIC_LIBS, test x"$version_specific_libs" = x"yes")
+ ],version_specific_libs=no)
+ AC_MSG_RESULT($version_specific_libs)
+ 
+ AC_MSG_CHECKING([for install location])
+ if test x"$version_specific_libs" = x"no" \
+    && test x"$gxx_include_dir"=x"no"; then
+   gxx_include_dir=${prefix}/include/g++-${libstdcxx_interface}
+ fi
+ AC_MSG_RESULT($gxx_include_dir)
+ AC_SUBST(gxx_include_dir)
+ ])
+ 
+ 
  # Check whether LC_MESSAGES is available in <locale.h>.
  # Ulrich Drepper <drepper@cygnus.com>, 1995.
  #
Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.in,v
retrieving revision 1.51
diff -c -p -r1.51 configure.in
*** configure.in	2001/02/01 21:08:04	1.51
--- configure.in	2001/02/06 05:47:39
*************** fi
*** 246,313 ****
  
  # Generate the various Makefiles, include files, and scripts.
  
- # This helps subvert libstdcxx_interface, as calculated by devo/config.if
  # Needed so that g++ can find the correct include subdir automatically.
  INTERFACE=v3
  
! # Check for the interface version number for specifying where header
! # files are installed, if a version number is provided.
! AC_MSG_CHECKING([for interface version number])
! libstdcxx_interface=$INTERFACE
! AC_MSG_RESULT($libstdcxx_interface)
! AC_SUBST(libstdcxx_interface)
! 
! # Process the option --with-gxx-include-dir=<path to include-files directory>
! AC_MSG_CHECKING([for --with-gxx-include-dir])
! AC_ARG_WITH(gxx-include-dir,
! [ --with-gxx-include-dir  the installation directory for include files],
! [case "${withval}" in
!   yes)
!     AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
!     gxx_include_dir=no
!     ;;
!   no)
!     gxx_include_dir=no
!     ;;
!   *)
!     gxx_include_dir=${withval}
!     ;;
! esac], [gxx_include_dir=no])
! AC_MSG_RESULT($gxx_include_dir)
! AC_SUBST(gxx_include_dir)
! AM_CONDITIONAL(GXX_INCLUDE_DIR, test x${gxx_include_dir} != xno)
! 
! # Process the option "--enable-version-specific-runtime-libs"
! AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
! AC_ARG_ENABLE(version-specific-runtime-libs,
! [  --enable-version-specific-runtime-libs    Specify that runtime libraries should be installed in a compiler-specific directory ],
! [  version_specific_libs=yes
! # Need the gcc compiler version to know where to install libraries
! # and header files if --enable-version-specific-runtime-libs option
! # is selected.
! changequote(,)dnl
! gcc_tmp=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $6}'`
! gcc_num=`echo ${gcc_tmp} | sed 's/\"//g'`
! #gcc_date=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $7}'`
! #gcc_version=$gcc_num-$gcc_date
! gcc_version=$gcc_num
! changequote([,])dnl
! AC_SUBST(gcc_version)
! ],version_specific_libs=no)
! AC_MSG_RESULT($version_specific_libs)
! if test x${version_specific_libs} = xyes; then
!   AM_CONDITIONAL(VERSION_SPECIFIC_LIBS, test x${version_specific_libs} = xyes)
!   AC_MSG_WARN(version specific directory is: $gcc_version)
! fi
! 
! # We have to install all the generated or linked includes files
! # specified as build_headers in src/Makefile.am in a target-dependent
! # place, or else multiple installs for different compilers will
! # overwrite these files.
! # NB: Keep this and gcc/Makefile.in's -DGPLUSPLUS_TOOL_INCLUDE_DIR in sync.
! gxx_target_include_dir='$(exec_prefix)/$(target_alias)/include/g++-$(libstdcxx_interface)'
! AC_SUBST(gxx_target_include_dir)
! 
  
  # Export all the include and flag information to makefiles.
  GLIBCPP_EXPORT_INCLUDES
--- 246,256 ----
  
  # Generate the various Makefiles, include files, and scripts.
  
  # Needed so that g++ can find the correct include subdir automatically.
  INTERFACE=v3
  
! # Export all the install information
! GLIBCPP_EXPORT_INSTALL_INFO
  
  # Export all the include and flag information to makefiles.
  GLIBCPP_EXPORT_INCLUDES
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.67
diff -c -p -r1.67 Makefile.am
*** Makefile.am	2001/02/03 09:01:44	1.67
--- Makefile.am	2001/02/06 05:47:40
*************** $(top_builddir)/stamp-cshadow: $(top_src
*** 227,244 ****
  
  
  # Check for various configure bits that change where the headers get installed.
! if GXX_INCLUDE_DIR
! myincludep = @gxx_include_dir@
! targetincludep = @gxx_include_dir@
! else
! if VERSION_SPECIFIC_LIBS
! myincludep = $(libdir)/gcc-lib/$(target_alias)/@gcc_version@/include/g++
! targetincludep = $(libdir)/gcc-lib/$(target_alias)/@gcc_version@/include/g++
! else
! myincludep = $(prefix)/include/g++-@libstdcxx_interface@
! targetincludep = @gxx_target_include_dir@
! endif
! endif
  
  # We have our own special, ridiculously complicated installation routine
  # here, as automake/autoconf is currently brain-damaged when it comes
--- 227,234 ----
  
  
  # Check for various configure bits that change where the headers get installed.
! gxx_include_dir = @gxx_include_dir@
! gxx_target_include_dir = $(gxx_include_dir)/$(target_alias)
  
  # We have our own special, ridiculously complicated installation routine
  # here, as automake/autoconf is currently brain-damaged when it comes
*************** install-data-local: myinstalldirs myinst
*** 258,266 ****
  # NB: installation of shadow header directories is not attempted.
  myinstalldirs:
  	if test -z "$(MULTISUBDIR)"; then \
! 	$(mkinstalldirs) $(DESTDIR)$(myincludep)/bits; \
! 	$(mkinstalldirs) $(DESTDIR)$(myincludep)/ext; \
! 	$(mkinstalldirs) $(DESTDIR)$(targetincludep)/bits; \
  	fi
  
  # NB: As libio_headers may be empty, need this to make sure bash doesn't
--- 248,256 ----
  # NB: installation of shadow header directories is not attempted.
  myinstalldirs:
  	if test -z "$(MULTISUBDIR)"; then \
! 	$(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/bits; \
! 	$(mkinstalldirs) $(DESTDIR)$(gxx_include_dir)/ext; \
! 	$(mkinstalldirs) $(DESTDIR)$(gxx_target_include_dir)/bits; \
  	fi
  
  # NB: As libio_headers may be empty, need this to make sure bash doesn't
*************** c_incdir = @C_INCLUDE_DIR@
*** 272,304 ****
  myinstallheaders: 
  	if test -z "$(MULTISUBDIR)"; then \
  	for i in $(base_headers); do \
!         echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/bits/"; \
! 	  $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/bits/; \
  	done; \
  	for i in $(ext_headers); do \
!         echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/ext/"; \
! 	  $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)/ext/; \
  	done; \
  	for i in $(backward_headers); do \
!         echo "$(INSTALL_DATA) $(src_incdir)/$$i $(myincludep)"; \
! 	  $(INSTALL_DATA) $(src_incdir)/$$i $(myincludep); \
  	done; \
  	for i in $(c_base_headers); do \
!         echo "$(INSTALL_DATA) $(c_incdir)/$$i $(myincludep)/bits/"; \
! 	  $(INSTALL_DATA) $(c_incdir)/$$i $(myincludep)/bits/; \
  	done; \
  	for i in $(std_headers); do \
! 	echo "$(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep)";\
! 	  $(INSTALL_DATA) $(src_incdir)/std/$$i $(myincludep); \
  	done; \
  	for i in $(build_headers); do \
!         echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(targetincludep)/bits/"; \
! 	  $(INSTALL_DATA) $(bld_incdir)/$$i $(targetincludep)/bits/; \
  	done; \
  	libio_headers_install='$(libio_headers)'; \
  	for i in $$libio_headers_install; do \
!         echo "$(INSTALL_DATA) $$i $(myincludep)"; \
!           $(INSTALL_DATA) $$i $(myincludep); \
  	done; \
  	fi;
  
--- 262,294 ----
  myinstallheaders: 
  	if test -z "$(MULTISUBDIR)"; then \
  	for i in $(base_headers); do \
!         echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/bits/"; \
! 	  $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/bits/; \
  	done; \
  	for i in $(ext_headers); do \
!         echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/ext/"; \
! 	  $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)/ext/; \
  	done; \
  	for i in $(backward_headers); do \
!         echo "$(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir)"; \
! 	  $(INSTALL_DATA) $(src_incdir)/$$i $(gxx_include_dir); \
  	done; \
  	for i in $(c_base_headers); do \
!         echo "$(INSTALL_DATA) $(c_incdir)/$$i $(gxx_include_dir)/bits/"; \
! 	  $(INSTALL_DATA) $(c_incdir)/$$i $(gxx_include_dir)/bits/; \
  	done; \
  	for i in $(std_headers); do \
! 	echo "$(INSTALL_DATA) $(src_incdir)/std/$$i $(gxx_include_dir)";\
! 	  $(INSTALL_DATA) $(src_incdir)/std/$$i $(gxx_include_dir); \
  	done; \
  	for i in $(build_headers); do \
!     echo "$(INSTALL_DATA) $(bld_incdir)/$$i $(gxx_target_include_dir)/bits/"; \
! 	  $(INSTALL_DATA) $(bld_incdir)/$$i $(gxx_target_include_dir)/bits/; \
  	done; \
  	libio_headers_install='$(libio_headers)'; \
  	for i in $$libio_headers_install; do \
!         echo "$(INSTALL_DATA) $$i $(gxx_include_dir)"; \
!           $(INSTALL_DATA) $$i $(gxx_include_dir); \
  	done; \
  	fi;
  
Index: libsupc++/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/Makefile.am,v
retrieving revision 1.17
diff -c -p -r1.17 Makefile.am
*** Makefile.am	2001/02/03 09:01:44	1.17
--- Makefile.am	2001/02/06 05:47:40
*************** sources = \
*** 100,116 ****
  libsupc___la_SOURCES = $(sources)
  libsupc__convenience_la_SOURCES = $(sources)
  
- # Check for various configure bits that change where the headers get installed.
- if GXX_INCLUDE_DIR
  glibcppinstalldir = @gxx_include_dir@
- else
- if VERSION_SPECIFIC_LIBS
- glibcppinstalldir = $(libdir)/gcc-lib/$(target_alias)/@gcc_version@/include/g++
- else
- glibcppinstalldir = $(prefix)/include/g++-@libstdcxx_interface@
- endif
- endif
- 
  glibcppinstall_HEADERS = $(headers)
  
  # Flags to force separate libtool library to be static only.
--- 100,106 ----



















Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]