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]
Other format: [Raw text]

Re: [PATCH RFC] installing libiberty headers, round three


I wrote:
> Tips, thoughts, reactions, comments from anyone would be appreciated.

Oops.  I posted the early version of the patch (the one with screwy shell
expansions), not the one in my tree.  Let's try again.



Index: configure.in
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libiberty/configure.in,v
retrieving revision 1.46
diff -u -3 -r1.46 configure.in
--- configure.in	31 Jan 2002 18:19:39 -0000	1.46
+++ configure.in	25 Feb 2002 12:24:45 -0000
@@ -205,6 +205,7 @@
 
 setobjs=
 CHECK=
+target_header_dir=
 if test -n "${with_target_subdir}"; then
 
   # We are being configured as a target library.  AC_REPLACE_FUNCS
@@ -239,6 +240,27 @@
 
   fi
 
+  # We may wish to install the target headers somewhere.
+  AC_ARG_ENABLE(install-libiberty,
+  [  --enable-install-libiberty       Install headers for end users],
+  enable_install_libiberty=$enableval,
+  enable_install_libiberty=no)dnl
+  
+  # Option parsed, now set things appropriately.
+  case x"$enable_install_libiberty" in
+    xyes|x)
+      target_header_dir=libiberty
+      ;;
+    xno)   
+      target_header_dir=
+      ;;
+    *) 
+      # This could be sanity-checked in various ways...
+      target_header_dir=${enable_install_libiberty}
+      ;;
+  esac
+
+
 else
 
    # Not a target library, so we set things up to run the test suite.
@@ -247,6 +269,7 @@
 fi
 
 AC_SUBST(CHECK)
+AC_SUBST(target_header_dir)
 
 case "${host}" in
   *-*-cygwin* | *-*-mingw*)
Index: Makefile.in
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libiberty/Makefile.in,v
retrieving revision 1.73
diff -u -3 -r1.73 Makefile.in
--- Makefile.in	22 Jan 2002 20:03:29 -0000	1.73
+++ Makefile.in	27 Feb 2002 12:05:45 -0000
@@ -1,6 +1,6 @@
 #
 # Makefile
-#   Copyright (C) 1990, 91-99, 2000, 2001
+#   Copyright (C) 1990, 91-99, 2000, 2001, 2002
 #   Free Software Foundation
 #
 # This file is part of the libiberty library.
@@ -34,6 +34,8 @@
 exec_prefix = @exec_prefix@
 bindir = @bindir@
 libdir = @libdir@
+includedir = @includedir@
+target_header_dir = @target_header_dir@
 
 SHELL = @SHELL@
 
@@ -48,6 +50,7 @@
 INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
+mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs
 
 AR = @AR@
 AR_FLAGS = rc
@@ -181,6 +184,22 @@
 	vasprintf.o vfork.o vfprintf.o vprintf.o vsprintf.o		\
 	waitpid.o
 
+# These files are installed if the library has been configured to do so.
+INSTALLED_HEADERS = config.h                                            \
+	$(INCDIR)/ansidecl.h                                            \
+	$(INCDIR)/demangle.h                                            \
+	$(INCDIR)/dyn-string.h                                          \
+	$(INCDIR)/fibheap.h                                             \
+	$(INCDIR)/floatformat.h                                         \
+	$(INCDIR)/hashtab.h                                             \
+	$(INCDIR)/libiberty.h                                           \
+	$(INCDIR)/objalloc.h                                            \
+	$(INCDIR)/partition.h                                           \
+	$(INCDIR)/safe-ctype.h                                          \
+	$(INCDIR)/sort.h                                                \
+	$(INCDIR)/splay-tree.h                                          \
+	$(INCDIR)/ternary.h
+
 $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
 	-rm -f $(TARGETLIB) pic/$(TARGETLIB)
 	$(AR) $(AR_FLAGS) $(TARGETLIB) \
@@ -240,6 +259,16 @@
 	$(INSTALL_DATA) $(TARGETLIB) $(libdir)$(MULTISUBDIR)/$(TARGETLIB)n
 	( cd $(libdir)$(MULTISUBDIR) ; $(RANLIB) $(TARGETLIB)n )
 	mv -f $(libdir)$(MULTISUBDIR)/$(TARGETLIB)n $(libdir)$(MULTISUBDIR)/$(TARGETLIB)
+	if test -n "${target_header_dir}"; then \
+	  case "${target_header_dir}" in \
+	    /*)    thd=${target_header_dir};; \
+	    *)     thd=${includedir}${MULTISUBDIR}/${target_header_dir};; \
+	  esac; \
+	  ${mkinstalldirs} $${thd}; \
+	  for h in ${INSTALLED_HEADERS}; do \
+	    ${INSTALL_DATA} $$h $${thd}; \
+	  done; \
+	fi
 	@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
 
 install_to_tooldir: all


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