From 249cb00d9f655778aa8a4519ee3e610a904d694d Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 11 May 2001 21:26:43 +0000 Subject: Rework where libraries get installed to. Now thew will be compiled and dropped into a uClibc/lib dir when compiling, which will make life a bit easier when installing and cleaning up. Preface uClibc with 'lib' so ldconfig will recognize it as a library. Make all libraries have the uClibc version number attached, making upgrades possible by using the traditional symlink to the .so name plan. -Erik --- .cvsignore | 5 ++++- Makefile | 31 ++++++------------------------- Rules.mak | 2 +- ldso/Makefile | 14 ++++++-------- libcrypt/Makefile | 34 ++++++++++++++-------------------- libm/Makefile | 26 +++++++++++++++----------- libutil/Makefile | 30 ++++++++++++++---------------- 7 files changed, 60 insertions(+), 82 deletions(-) diff --git a/.cvsignore b/.cvsignore index 021ef7b6d..0197571b1 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,5 +1,8 @@ libc.a libcrt0.o -libuClibc.so.1 +uClibc.so* +libuClibc.so* uClibc_config.h uClibc-0* +libuClibc-0* +lib diff --git a/Makefile b/Makefile index de78bf76f..4957111ab 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ # Makefile for uClibc # -# Copyright (C) 2000 by Lineo, inc. +# Copyright (C) 2000, 2001 by Lineo, inc. +# Written by Erik Andersen , # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Library General Public License as published by the Free @@ -56,7 +57,8 @@ shared: $(LIBNAME) ./$(LIBNAME) $(LDSO) ; \ fi @rm -rf tmp - ln -sf $(SHARED_FULLNAME) $(SHARED_MAJORNAME) + cp -a $(SHARED_FULLNAME) lib; + (cd lib; ln -sf $(SHARED_FULLNAME) $(SHARED_MAJORNAME)); @$(MAKE) -C libcrypt shared @$(MAKE) -C libutil shared @$(MAKE) -C libm shared @@ -110,23 +112,12 @@ $(patsubst %, _dir_%, $(DIRS)) : dummy $(patsubst %, _dirclean_%, $(DIRS) test) : dummy $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean -install: install_runtime install_dev install_ldso +install: install_runtime install_dev # Installs shared library install_runtime: - @$(MAKE) -C libcrypt install - @$(MAKE) -C libutil install - @$(MAKE) -C libm install -ifneq ($(DO_SHARED),) install -d $(INSTALL_DIR)/lib - rm -rf $(INSTALL_DIR)/lib/$(SHARED_FULLNAME) - rm -rf $(INSTALL_DIR)/lib/$(SHARED_MAJORNAME) - rm -rf $(INSTALL_DIR)/lib/libc.so - install -m 755 $(SHARED_FULLNAME) $(INSTALL_DIR)/lib/ - (cd $(INSTALL_DIR)/lib;ln -sf $(SHARED_FULLNAME) $(SHARED_MAJORNAME)) -else - echo shared library not installed -endif + cp -fa lib/* $(INSTALL_DIR)/lib; # Installs development library and headers # This is done with the assumption that it can blow away anything @@ -149,16 +140,6 @@ install_dev: install -d $(INSTALL_DIR)/bin $(MAKE) -C extra/gcc-uClibc install - -install_ldso: -ifeq ($(strip $(DO_SHARED)),shared) - $(MAKE) -C ld.so-1 install - install -d $(INSTALL_DIR)/etc - #$(TOPDIR)ld.so-1/util/ldconfig -else - @echo "Skipping shared library support" -endif - uClibc_config.h: Config @echo "/* WARNING!!! AUTO-GENERATED FILE!!! DO NOT EDIT!!! */" > uClibc_config.h @echo "#if !defined __FEATURES_H && !defined __need_uClibc_config_h" >> uClibc_config.h diff --git a/Rules.mak b/Rules.mak index 85bde6d4a..9fa518bfe 100644 --- a/Rules.mak +++ b/Rules.mak @@ -28,7 +28,7 @@ MAJOR_VERSION=0 MINOR_VERSION=9.5 LIBNAME=libc.a -SHARED_FULLNAME=uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so +SHARED_FULLNAME=libuClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so SHARED_MAJORNAME=libc.so.$(MAJOR_VERSION) UCLIBC_LDSO=ld-uclibc.so.$(MAJOR_VERSION) diff --git a/ldso/Makefile b/ldso/Makefile index 25f9974f7..d7af33f89 100644 --- a/ldso/Makefile +++ b/ldso/Makefile @@ -8,14 +8,12 @@ all: @if [ -d $(TOPDIR)ld.so-1/d-link/$(TARGET_ARCH) ] ; then \ set -e ; for d in $(SUBDIRS) ; do $(MAKE) -C $$d ; done \ fi; - -install: all - if [ -d $(TOPDIR)ld.so-1/d-link/$(TARGET_ARCH) ] ; then \ - install -d $(INSTALL_DIR)/lib $(INSTALL_DIR)/etc ; \ - install -m 755 $(TOPDIR)ld.so-1/d-link/$(UCLIBC_LDSO) $(INSTALL_DIR)/lib/ld-linux-uclibc.so ; \ - install -m 644 $(TOPDIR)ld.so-1/libdl/$(LIBDL).$(MAJOR_VERSION) $(INSTALL_DIR)/lib/ ; \ - (cd $(INSTALL_DIR)/lib/;ln -sf ld-linux-uclibc.so $(UCLIBC_LDSO)); \ - (cd $(INSTALL_DIR)/lib/;ln -sf $(LIBDL).$(MAJOR_VERSION) $(LIBDL)) ; \ + @if [ -d $(TOPDIR)ld.so-1/d-link/$(TARGET_ARCH) ] ; then \ + install -d $(TOPDIR)lib ; \ + install -m 755 $(TOPDIR)ld.so-1/d-link/$(UCLIBC_LDSO) $(TOPDIR)lib/ld-linux-uclibc.so ; \ + install -m 644 $(TOPDIR)ld.so-1/libdl/$(LIBDL).$(MAJOR_VERSION) $(TOPDIR)lib ; \ + (cd $(TOPDIR)lib;ln -sf ld-linux-uclibc.so $(UCLIBC_LDSO)); \ + (cd $(TOPDIR)lib;ln -sf $(LIBDL).$(MAJOR_VERSION) $(LIBDL)) ; \ fi; ldso: diff --git a/libcrypt/Makefile b/libcrypt/Makefile index f4280a4e7..a3cff4fc6 100644 --- a/libcrypt/Makefile +++ b/libcrypt/Makefile @@ -25,13 +25,11 @@ include $(TOPDIR)Rules.mak LIBCRYPT=libcrypt.a LIBCRYPT_SHARED=libcrypt.so +LIBCRYPT_SHARED_FULLNAME=libcrypt-$(MAJOR_VERSION).$(MINOR_VERSION).so TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc CSRC = crypt.c des.c md5.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - - -OBJS=$(COBJS) +OBJS=$(patsubst %.c,%.o, $(CSRC)) all: $(OBJS) $(LIBCRYPT) @@ -39,28 +37,24 @@ $(LIBCRYPT): ar-target ar-target: $(OBJS) $(AR) $(ARFLAGS) $(LIBCRYPT) $(OBJS) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBCRYPT) + install -m 644 $(LIBCRYPT) $(TOPDIR)lib/ -$(COBJS): %.o : %.c +$(OBJS): %.o : %.c $(TARGET_CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o $(OBJ): Makefile -shared: $(LIBCRYPT) - $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBCRYPT_SHARED).$(MAJOR_VERSION) \ - -Wl,-soname,$(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(COBJS) $(TOPDIR)$(SHARED_FULLNAME) - -install: all - install -d $(INSTALL_DIR)/lib - install -m 644 $(LIBCRYPT) $(INSTALL_DIR)/lib/ - @if [ -f $(LIBCRYPT_SHARED).$(MAJOR_VERSION) ] ; then \ - install -m 644 $(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(INSTALL_DIR)/lib/; \ - (cd $(INSTALL_DIR)/lib/;ln -sf $(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(LIBCRYPT_SHARED)); \ - fi; +shared: all + $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBCRYPT_SHARED_FULLNAME) \ + -Wl,-soname,$(LIBCRYPT_SHARED).$(MAJOR_VERSION) $(OBJS) $(TOPDIR)$(SHARED_FULLNAME) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBCRYPT_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBCRYPT_SHARED).$(MAJOR_VERSION) + install -m 644 $(LIBCRYPT_SHARED_FULLNAME) $(TOPDIR)lib/; + (cd $(TOPDIR)lib; ln -sf $(LIBCRYPT_SHARED_FULLNAME) $(LIBCRYPT_SHARED).$(MAJOR_VERSION)); clean: - rm -f *.[oa] *~ core $(LIBCRYPT_SHARED)* - -.PHONY: dummy - + rm -f *.[oa] *~ core $(LIBCRYPT_SHARED)* $(LIBCRYPT_SHARED_FULLNAME)* diff --git a/libm/Makefile b/libm/Makefile index 6beb52b0a..7227e664f 100644 --- a/libm/Makefile +++ b/libm/Makefile @@ -25,6 +25,7 @@ include $(TOPDIR)Rules.mak LIBM=libm.a LIBM_SHARED=libm.so +LIBM_SHARED_FULLNAME=libm-$(MAJOR_VERSION).$(MINOR_VERSION).so TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc DIRS= @@ -42,20 +43,23 @@ ALL_SUBDIRS = float double ldouble all: $(LIBM) $(LIBM): subdirs + @if [ -f $(LIBM) ] ; then \ + install -d $(TOPDIR)lib; \ + rm -f $(TOPDIR)lib/$(LIBM); \ + install -m 644 $(LIBM) $(TOPDIR)lib; \ + fi; tags: ctags -R -shared: $(LIBM) - $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBM_SHARED).$(MAJOR_VERSION) \ - -Wl,-soname,$(LIBM_SHARED).$(MAJOR_VERSION) -Wl,--whole-archive $(LIBM) $(TOPDIR)$(SHARED_FULLNAME) - -install: all - install -d $(INSTALL_DIR)/lib - install -m 644 $(LIBM) $(INSTALL_DIR)/lib/ - @if [ -f $(LIBM_SHARED).$(MAJOR_VERSION) ] ; then \ - install -m 644 $(LIBM_SHARED).$(MAJOR_VERSION) $(INSTALL_DIR)/lib/; \ - (cd $(INSTALL_DIR)/lib/;ln -sf $(LIBM_SHARED).$(MAJOR_VERSION) $(LIBM_SHARED)); \ +shared: all + @if [ -f $(LIBM) ] ; then \ + $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBM_SHARED_FULLNAME) \ + -Wl,-soname,$(LIBM_SHARED).$(MAJOR_VERSION) $(OBJS) $(TOPDIR)$(SHARED_FULLNAME); \ + install -d $(TOPDIR)lib; \ + rm -f $(TOPDIR)lib/$(LIBM_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBM_SHARED).$(MAJOR_VERSION); \ + install -m 644 $(LIBM_SHARED_FULLNAME) $(TOPDIR)lib; \ + (cd $(TOPDIR)lib; ln -sf $(LIBM_SHARED_FULLNAME) $(LIBM_SHARED).$(MAJOR_VERSION)); \ fi; subdirs: $(patsubst %, _dir_%, $(DIRS)) @@ -68,7 +72,7 @@ $(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy $(MAKE) -C $(patsubst _dirclean_%, %, $@) clean clean: subdirs_clean - rm -f *.[oa] *~ core $(LIBM_SHARED)* $(LIBM) + rm -f *.[oa] *~ core $(LIBM_SHARED)* $(LIBM_SHARED_FULLNAME)* .PHONY: dummy diff --git a/libutil/Makefile b/libutil/Makefile index 364e82538..f98a4c46d 100644 --- a/libutil/Makefile +++ b/libutil/Makefile @@ -26,12 +26,11 @@ LIBC=$(TOPDIR)libc.a LIBUTIL=libutil.a LIBUTIL_SHARED=libutil.so +LIBUTIL_SHARED_FULLNAME=libutil-$(MAJOR_VERSION).$(MINOR_VERSION).so TARGET_CC= $(TOPDIR)extra/gcc-uClibc/$(TARGET_ARCH)-uclibc-gcc CSRC=forkpty.c login.c login_tty.c logout.c logwtmp.c openpty.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) - -OBJS=$(COBJS) +OBJS=$(patsubst %.c,%.o, $(CSRC)) all: $(OBJS) $(LIBC) @@ -39,23 +38,22 @@ $(LIBC): ar-target ar-target: $(OBJS) $(AR) $(ARFLAGS) $(LIBUTIL) $(OBJS) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBUTIL) + install -m 644 $(LIBUTIL) $(TOPDIR)lib/ -$(COBJS): %.o : %.c +$(OBJS): %.o : %.c $(TARGET_CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o -shared: $(LIBUTIL) - $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBUTIL_SHARED).$(MAJOR_VERSION) \ - -Wl,-soname,$(LIBUTIL_SHARED).$(MAJOR_VERSION) $(COBJS) $(TOPDIR)$(SHARED_FULLNAME) - -install: all - install -d $(INSTALL_DIR)/lib - install -m 644 $(LIBUTIL) $(INSTALL_DIR)/lib/ - @if [ -f $(LIBUTIL_SHARED).$(MAJOR_VERSION) ] ; then \ - install -m 644 $(LIBUTIL_SHARED).$(MAJOR_VERSION) $(INSTALL_DIR)/lib/; \ - (cd $(INSTALL_DIR)/lib/;ln -sf $(LIBUTIL_SHARED).$(MAJOR_VERSION) $(LIBUTIL_SHARED)); \ - fi; +shared: all + $(TARGET_CC) $(LDFLAGS) -shared -o $(LIBUTIL_SHARED_FULLNAME) \ + -Wl,-soname,$(LIBUTIL_SHARED).$(MAJOR_VERSION) $(OBJS) $(TOPDIR)$(SHARED_FULLNAME) + install -d $(TOPDIR)lib + rm -f $(TOPDIR)lib/$(LIBUTIL_SHARED_FULLNAME) $(TOPDIR)lib/$(LIBUTIL_SHARED).$(MAJOR_VERSION) + install -m 644 $(LIBUTIL_SHARED_FULLNAME) $(TOPDIR)lib/; + (cd $(TOPDIR)lib; ln -sf $(LIBUTIL_SHARED_FULLNAME) $(LIBUTIL_SHARED).$(MAJOR_VERSION)); clean: - rm -f *.[oa] *~ core $(LIBUTIL_SHARED).$(MAJOR_VERSION) + rm -f *.[oa] *~ core $(LIBUTIL_SHARED)* $(LIBUTIL_SHARED_FULLNAME)* -- cgit v1.2.3