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]

install libiberty headers, round two


Betcha thought I'd forgotten this.  :-)  After the many helpful comments
generated from this

    http://gcc.gnu.org/ml/gcc-patches/2001-01/msg00411.html

thread, I finally got 'round to adding the --enable-install-libiberty
configure option.  It's off by default.  If turned on with no argument
(or with =yes, etc) then it defaults to $prefix/include/libiberty, so
users can write things like

    #include <libiberty/md5.h>

If enabled with a real argument, the headers are installed there instead.

Comments?



Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/configure.in,v
retrieving revision 1.32
diff -c -3 -r1.32 configure.in
*** configure.in	2001/03/06 09:52:35	1.32
--- configure.in	2001/03/25 01:52:38
***************
*** 180,185 ****
--- 180,207 ----
  
    fi
  
+   # We may wish to install the target library/headers somewhere.
+   AC_ARG_ENABLE(install-libiberty,
+ [--enable-install-libiberty       Install header and library],
+   enable_install_libiberty=$enableval,
+   enable_install_libiberty=no)dnl
+   
+   # Option parsed, now set things appropriately.
+   case "$enable_install_libiberty" in
+     yes) 
+       target_header_dir=${prefix}/include/libiberty
+       ;;
+     no)   
+       target_header_dir=''
+       ;;
+     *) 
+       # This could be sanity-checked in various ways...
+       target_header_dir=${enable_install_libiberty}
+       ;;
+   esac
+   AC_SUBST(target_header_dir)
+ 
+ 
  else
  
     # Not a target library, so we set things up to run the test suite.
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/libiberty/Makefile.in,v
retrieving revision 1.60
diff -c -3 -r1.60 Makefile.in
*** Makefile.in	2001/03/21 07:29:37	1.60
--- Makefile.in	2001/03/25 01:52:38
***************
*** 48,53 ****
--- 48,54 ----
  INSTALL = @INSTALL@
  INSTALL_PROGRAM = @INSTALL_PROGRAM@
  INSTALL_DATA = @INSTALL_DATA@
+ mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs
  
  AR = @AR@
  AR_FLAGS = rc
***************
*** 62,67 ****
--- 63,69 ----
  MAKEOVERRIDES =
  
  TARGETLIB = libiberty.a
+ target_header_dir = @target_header_dir@
  
  LIBOBJS = @LIBOBJS@
  
***************
*** 117,122 ****
--- 119,132 ----
  clean-info: clean-info-subdir
  dvi: dvi-subdir
  
+ # Include files not necessarily in this directory which must be installed.
+ TARGET_HFILES = config.h $(INCDIR)/demangle.h                              \
+ 	$(INCDIR)/dyn-string.h $(INCDIR)/floatformat.h $(INCDIR)/fnmatch.h    \
+ 	$(INCDIR)/getopt.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h          \
+ 	$(INCDIR)/md5.h $(INCDIR)/objalloc.h $(INCDIR)/obstack.h              \
+ 	$(INCDIR)/partition.h $(INCDIR)/safe-ctype.h $(INCDIR)/sort.h         \
+ 	$(INCDIR)/splay-tree.h $(INCDIR)/symcat.h
+ 
  # NOTE: If you add new files to the library, add them to this list
  # (alphabetical), and add them to REQUIRED_OFILES or funcs in
  # configure.in.
***************
*** 156,161 ****
--- 166,177 ----
  	$(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 \
+ 	  $(mkinstalldirs) $(target_header_dir) ; \
+ 	  for h in $(TARGET_HFILES); do \
+ 	    $(INSTALL_DATA) $$h $(target_header_dir) ; \
+ 	  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]