Changeset 1675

Show
Ignore:
Timestamp:
12/18/02 03:49:54 (10 years ago)
Author:
mds
Message:

add several checks and warnings when installing libraries

to catch common problems where the new libs won't be found or used

Location:
lm-sensors/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r1673 r1675  
    2121  File sensors.conf.eg: Fix vt1211/vt8231 thermistor calculations 
    2222  Library: Add support for exponents and logarithms for vt1211/vt8235 
     23  Makefile: Generate warnings if new library won't be found by ld.so 
    2324  Module i2c-i810.c: Fix for some chips 
    2425  Module w83627hf: New 
  • lm-sensors/trunk/lib/Module.mk

    r1670 r1675  
    8686all :: all-lib 
    8787 
     88# Generate warnings if the install directory isn't in /etc/ld.so.conf 
     89# or if the library wasn't there before (which means ldconfig must be run). 
     90# Don't generate warning about old versions in /usr/lib unless the new version 
     91# won't be picked up, since ld.so looks at the directories in ld.so.conf 
     92# before it looks at /usr/lib. 
    8893install-lib: all-lib 
    8994        $(MKDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(LIBINCLUDEDIR) $(DESTDIR)$(LIBMAN3DIR) $(DESTDIR)$(LIBMAN5DIR) 
     95        @if [ ! -e "$(DESTDIR)$(LIBDIR)/$(LIBSHSONAME)" ] ; then \ 
     96             echo '******************************************************************************' ;  \ 
     97             echo 'Warning: This is the first installation of the $(LIBSHBASENAME)*' ; \ 
     98             echo '         library files in $(DESTDIR)$(LIBDIR) !!!' ; \ 
     99             echo '         You must run /sbin/ldconfig to update the library cache or' ; \ 
     100             echo '         the userspace tools may fail or have unpredictable results !!!' ; \ 
     101             echo '******************************************************************************' ;  \ 
     102        fi 
    90103        $(INSTALL) -o root -g root -m 644 $(LIBTARGETS) $(DESTDIR)$(LIBDIR) 
    91104        $(LN) $(LIBSHLIBNAME) $(DESTDIR)$(LIBDIR)/$(LIBSHSONAME) 
    92105        $(LN) $(LIBSHSONAME) $(DESTDIR)$(LIBDIR)/$(LIBSHBASENAME) 
     106        @if [ "$(DESTDIR)$(LIBDIR)" != "/usr/lib" -a "$(DESTDIR)$(LIBDIR)" != "/lib" ] ; then \ 
     107           grep -q '^$(DESTDIR)$(LIBDIR)$$' /etc/ld.so.conf || \ 
     108           grep -q '^$(DESTDIR)$(LIBDIR)[[:space:]:,=]' /etc/ld.so.conf || \ 
     109           grep -q '[[:space:]:,]$(DESTDIR)$(LIBDIR)$$' /etc/ld.so.conf || \ 
     110           grep -q '[[:space:]:,]$(DESTDIR)$(LIBDIR)[[:space:]:,=]' /etc/ld.so.conf || \ 
     111                ( echo '******************************************************************************' ;  \ 
     112                  echo 'Warning: Library directory $(DESTDIR)$(LIBDIR) not in /etc/ld.so.conf !!!' ;  \ 
     113                  echo '         Add it and run /sbin/ldconfig for the userspace tools to work !!!' ; \ 
     114                  if [ -e "/usr/lib/$(LIBSHSONAME)" ] ; then \ 
     115                     echo '         Even worse, you have old $(LIBSHBASENAME)* library files in /usr/lib !!!' ;  \ 
     116                     echo '         These will be used instead which will cause unpredictable results !!!' ; \ 
     117                  fi ; \ 
     118                  echo '******************************************************************************' ) ;  \ 
     119        fi 
    93120        $(INSTALL) -o root -g root -m 644 $(LIBHEADERFILES) $(DESTDIR)$(LIBINCLUDEDIR) 
    94121        $(INSTALL) -o $(MANOWN) -g $(MANGRP) -m 644 $(LIBMAN3FILES) $(DESTDIR)$(LIBMAN3DIR) 
    95122        $(INSTALL) -o $(MANOWN) -g $(MANGRP) -m 644 $(LIBMAN5FILES) $(DESTDIR)$(LIBMAN5DIR) 
     123 
    96124 
    97125install :: install-lib