From a992701d886fa5213bcfdf1db7b3edff127c6781 Mon Sep 17 00:00:00 2001 From: Scott Christley Date: Thu, 30 Oct 1997 22:23:50 +0000 Subject: [PATCH] Make the system root be the default installation root. Use test.make for test programs so that they do not get installed. Fix NSBundle so that it removes the library combo, target os, and target cpu when determining the bundle's dir path. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2592 72102866-910b-0410-8b05-ffd578937521 --- Admin/Makefile | 3 +++ ChangeLog | 23 +++++++++++++++++++++++ Documentation/Makefile | 3 +++ Examples/Makefile | 7 +++++-- Makefile | 2 ++ NSCharacterSets/Makefile | 3 +++ NSTimeZones/Makefile | 3 +++ Source/Makefile | 13 +++++++++---- Source/Makefile.postamble | 3 +++ Source/NSBundle.m | 32 +++++++++++++++++++++++++++++++- Source/externs.m | 2 +- Testing/Makefile | 12 +++++++----- Tools/Makefile | 29 +++++++++++++++++++++++++++-- 13 files changed, 120 insertions(+), 15 deletions(-) diff --git a/Admin/Makefile b/Admin/Makefile index 81874170c..100590266 100644 --- a/Admin/Makefile +++ b/Admin/Makefile @@ -20,6 +20,9 @@ # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Install into the system root by default +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) + include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make include ../Version diff --git a/ChangeLog b/ChangeLog index 435b48210..ee7818044 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +Thu Oct 30 13:38:51 1997 Scott Christley + + * Makefile (GNUSTEP_INSTALLATION_DIR): Make default be system. + * NSCharacterSets/Makefile: Likewise. + * NSTimeZones/Makefile: Likewise. + * Tools/Makefile: Likewise. Use objc.make instead of tool.make + as the file does not require the foundation library. + * admin/Makefile: Likewise. + * checks/Makefile: Likewise. Use test.make so that + the programs do not get installed. + * doc/Makefile: Likewise. + * examples/Makefile: Likewise. Use test.make so that the + programs do not get installed. + * src/Makefile: Likewise. Alter names to correspond with + the new recursive library.make. + * src/Makefile.postamble: Uninstall header files. + + * src/NSBundle.m (+mainBundle): Strip off library combo, target + os and target cpu is they are part of the directory list to + the executable so that the bundle path is the top level dir. + + * src/externs.m (NSNonRetainedObjectHashCallbacks): Correct name. + Thu Oct 30 14:32:28 1997 Adam Fedor * Makefile (GNUSTEP_INSTALLATION_DIR): New variable. diff --git a/Documentation/Makefile b/Documentation/Makefile index f637d183a..dafad88ce 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -20,6 +20,9 @@ # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Install into the system root by default +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) + include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make include ../Version diff --git a/Examples/Makefile b/Examples/Makefile index 1202ea2c9..3f42190b0 100644 --- a/Examples/Makefile +++ b/Examples/Makefile @@ -22,13 +22,16 @@ # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # +# Install into the system root by default +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) + include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make include ../Version include ../config.mak # The tools to be compiled -TOOL_NAME = \ +TEST_TOOL_NAME = \ dictionary \ stdio-stream \ textcoding \ @@ -60,6 +63,6 @@ custom-zone.m -include Makefile.preamble -include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/tool.make +include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/test.make -include Makefile.postamble diff --git a/Makefile b/Makefile index 261b6b32a..c4098db19 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,8 @@ # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # + +# Install into the system root by default GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make diff --git a/NSCharacterSets/Makefile b/NSCharacterSets/Makefile index b4ecd4d8b..2cd780296 100644 --- a/NSCharacterSets/Makefile +++ b/NSCharacterSets/Makefile @@ -20,6 +20,9 @@ # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Install into the system root by default +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) + include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make include ../Version diff --git a/NSTimeZones/Makefile b/NSTimeZones/Makefile index a433c6d42..6cab17a20 100644 --- a/NSTimeZones/Makefile +++ b/NSTimeZones/Makefile @@ -20,6 +20,9 @@ # License along with this library; if not, write to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Install into the system root by default +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) + include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make include ../Version diff --git a/Source/Makefile b/Source/Makefile index d29d5da5e..26cb69587 100644 --- a/Source/Makefile +++ b/Source/Makefile @@ -22,6 +22,9 @@ # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # +# Install into the system root by default +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) + include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make include ../Version @@ -39,6 +42,8 @@ LIBRARY_NAME=libgnustep-base DEFS= -DGNUSTEP_INSTALL_PREFIX=$(GNUSTEP_SYSTEM_ROOT) \ -DPLATFORM_OS=\"$(GNUSTEP_TARGET_OS)\" \ -DGNUSTEP_TARGET_DIR=\"$(GNUSTEP_TARGET_DIR)\" \ + -DGNUSTEP_TARGET_CPU=\"$(GNUSTEP_TARGET_CPU)\" \ + -DGNUSTEP_TARGET_OS=\"$(GNUSTEP_TARGET_OS)\" \ -DLIBRARY_COMBO=\"$(LIBRARY_COMBO)\" # Grep for these names to build the legally-required "AUTHORS" file. @@ -471,12 +476,12 @@ dynamic-load.h \ include/preface.h # The C source files to be compiled -libgnustep-base_C_FILES = $(GNU_CFILES) $(NEXTSTEP_CFILES) $(NEXTSTEP_DERIVED_CFILES) \ - $(BASE_CFILES) +libgnustep-base_C_FILES = $(GNU_CFILES) $(NEXTSTEP_CFILES) \ + $(NEXTSTEP_DERIVED_CFILES) $(BASE_CFILES) # The Objective-C source files to be compiled -libgnustep-base_OBJC_FILES = $(GNU_MFILES) $(NEXTSTEP_MFILES) $(BASE_MFILES) \ - $(NSVALUE_MFILES) $(NSNUMBER_MFILES) +libgnustep-base_OBJC_FILES = $(GNU_MFILES) $(NEXTSTEP_MFILES) \ + $(BASE_MFILES) $(NSVALUE_MFILES) $(NSNUMBER_MFILES) libgnustep-base_HEADER_FILES_DIR = . libgnustep-base_HEADER_FILES_INSTALL_DIR = /gnustep/base diff --git a/Source/Makefile.postamble b/Source/Makefile.postamble index 50fa9b8cd..fd37d450c 100644 --- a/Source/Makefile.postamble +++ b/Source/Makefile.postamble @@ -59,6 +59,9 @@ after-install:: # Things to do after uninstalling after-uninstall:: + for file in $(GNU_HEADERS); do \ + rm $(GNUSTEP_HEADERS)/gnustep/base/$$file ; \ + done # Things to do before cleaning # before-clean:: diff --git a/Source/NSBundle.m b/Source/NSBundle.m index c34266547..65ca21b2d 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -116,6 +116,18 @@ static NSString* gnustep_target_dir = #else nil; #endif +static NSString* gnustep_target_cpu = +#ifdef GNUSTEP_TARGET_CPU + @GNUSTEP_TARGET_CPU; +#else + nil; +#endif +static NSString* gnustep_target_os = +#ifdef GNUSTEP_TARGET_OS + @GNUSTEP_TARGET_OS; +#else + nil; +#endif static NSString* library_combo = #ifdef LIBRARY_COMBO @LIBRARY_COMBO; @@ -232,7 +244,7 @@ _bundle_load_callback(Class theClass, Category *theCategory) if ( !_mainBundle ) { char *output; - NSString *path; + NSString *path, *s; path = [[NSProcessInfo processInfo] processName]; output = objc_find_executable([path cString]); @@ -243,6 +255,24 @@ _bundle_load_callback(Class theClass, Category *theCategory) /* Strip off the name of the program */ path = [path stringByDeletingLastPathComponent]; + /* The executable may not lie in the main bundle directory + so we need to chop off the extra subdirectories, the library + combo and the target cpu/os if they exist. The executable and + this library should match so that is why we can use the + compiled-in settings. */ + /* library combo */ + s = [path lastPathComponent]; + if ([s isEqual: library_combo]) + path = [path stringByDeletingLastPathComponent]; + /* target os */ + s = [path lastPathComponent]; + if ([s isEqual: gnustep_target_os]) + path = [path stringByDeletingLastPathComponent]; + /* target cpu */ + s = [path lastPathComponent]; + if ([s isEqual: gnustep_target_cpu]) + path = [path stringByDeletingLastPathComponent]; + #ifdef DEBUG fprintf(stderr, "Debug (NSBundle): Found main in %s\n", [path cString]); diff --git a/Source/externs.m b/Source/externs.m index 60d6b9273..9b97e26a2 100644 --- a/Source/externs.m +++ b/Source/externs.m @@ -253,7 +253,7 @@ const NSHashTableCallBacks NSNonOwnedPointerHashCallBacks = (NSHT_describe_func_t) _NS_owned_void_p_describe }; -const NSHashTableCallBacks NSNonRetainedObjectsHashCallBacks = +const NSHashTableCallBacks NSNonRetainedObjectHashCallBacks = { (NSHT_hash_func_t) _NS_non_retained_id_hash, (NSHT_isEqual_func_t) _NS_non_retained_id_is_equal, diff --git a/Testing/Makefile b/Testing/Makefile index c4da4745d..f7ea69ac0 100644 --- a/Testing/Makefile +++ b/Testing/Makefile @@ -22,13 +22,16 @@ # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # +# Install into the system root by default +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) + include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make include ../Version include ../config.mak # The tools to be compiled -TOOL_NAME = \ +TEST_TOOL_NAME = \ test01 \ test02 \ heap \ @@ -123,7 +126,7 @@ create-abbrevs_OBJC_FILES = create-abbrevs.m create-regions_OBJC_FILES = create-regions.m # The bundles to be compiled -BUNDLE_NAME=LoadMe +TEST_BUNDLE_NAME=LoadMe # The bundle Objective-C source files to be compiled LoadMe_OBJC_FILES = LoadMe.m MyCategory.m SecondClass.m @@ -132,7 +135,7 @@ LoadMe_OBJC_FILES = LoadMe.m MyCategory.m SecondClass.m LoadMe_RESOURCES = English.lproj/NXStringTable.example LoadMe_RESOURCE_DIRS = English.lproj -SRCS = $(TOOL_NAME:=.m) +SRCS = $(TEST_TOOL_NAME:=.m) HDRS = \ server.h \ @@ -153,7 +156,6 @@ DIST_FILES = $(SRCS) $(HDRS) $(DYNAMIC_MFILES) $(DYNAMIC_HFILES) \ -include Makefile.preamble -include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/tool.make -include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/bundle.make +include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/test.make -include Makefile.postamble diff --git a/Tools/Makefile b/Tools/Makefile index 3dcc5b6d1..71e76a863 100644 --- a/Tools/Makefile +++ b/Tools/Makefile @@ -1,13 +1,38 @@ +# +# Tools makefile for GNUstep Base Library +# Copyright (C) 1997 Free Software Foundation, Inc. +# +# Written by: Richard Frith-Macdonald +# +# This file is part of the GNUstep Base Library. +# +# This library 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 Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +# Install into the system root by default +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT) + include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/common.make # The application to be compiled -TOOL_NAME = gdomap +OBJC_PROGRAM_NAME = gdomap # The source files to be compiled gdomap_C_FILES = gdomap.c -include Makefile.preamble -include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/tool.make +include $(GNUSTEP_SYSTEM_ROOT)/Makefiles/objc.make -include Makefile.postamble