diff --git a/ChangeLog b/ChangeLog index f9cbb5142..02b468741 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2016-08-19 Richard Frith-Macdonald + + * config/objc-common.g: Darwin patch by David Wetzel + * Source/CompatibilityHeaders.make: Delete obsolete file + * configure.ac: Check for libdispatch runloop integration functions + * Headers/GNUstepBase/GSConfig.h.in: New define for libdispatch + * config.mak.in: New define for libdispatch + * Tests/base/NSRunLoop/dispatch.m: Use new define + * configure: Regenerate + * Source/Additions/Makefile.preamble: + * Source/GNUmakefile: + * Source/Makefile.postamble: + * Source/Makefile.preamble: + * Source/ObjectiveC2/Makefile.preamble: + * Source/unix/Makefile.preamble: + * Source/win32/Makefile.preamble: + * Tools/Makefile.preamble: + * Tools/make_strings/GNUmakefile.preamble: + Mostly tweaks for building cleanly non-flattened and removal of a few + long deprecated directories/headers. + Configuration time change by David Wetzel for building on OSX + 2016-07-27 Niels Grewe * Header/Foundation/NSData.h diff --git a/Headers/GNUstepBase/GSConfig.h.in b/Headers/GNUstepBase/GSConfig.h.in index 1f3190c09..2aeef8731 100644 --- a/Headers/GNUstepBase/GSConfig.h.in +++ b/Headers/GNUstepBase/GSConfig.h.in @@ -269,6 +269,7 @@ typedef struct { #define GS_USE_MDNS @HAVE_MDNS@ #define GS_USE_ICU @HAVE_ICU@ #define GS_USE_LIBDISPATCH @HAVE_LIBDISPATCH@ +#define GS_USE_LIBDISPATCH_RUNLOOP @HAVE_LIBDISPATCH_RUNLOOP@ #define GS_HAVE_OBJC_ROOT_CLASS_ATTR @GS_HAVE_OBJC_ROOT_CLASS_ATTR@ #ifndef __has_include diff --git a/Source/Additions/Makefile.preamble b/Source/Additions/Makefile.preamble index e214be84b..de2bafb8a 100644 --- a/Source/Additions/Makefile.preamble +++ b/Source/Additions/Makefile.preamble @@ -58,7 +58,6 @@ endif ADDITIONAL_CFLAGS = # Additional include directories the compiler should search -# FIXME - the -I../ is for GSPrivate.h ADDITIONAL_INCLUDE_DIRS = -I../$(GNUSTEP_TARGET_DIR) -I../ # We include the main base Headers if we are building using the base library diff --git a/Source/CompatibilityHeaders.make b/Source/CompatibilityHeaders.make deleted file mode 100644 index 4962e59d4..000000000 --- a/Source/CompatibilityHeaders.make +++ /dev/null @@ -1,80 +0,0 @@ -# -*-makefile-*- -# CompatibilityHeaders.make -# -# Create compatibility headers so that code written before the big header -# move will continue to compile (for a while). -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# -# -# Author: Alexander Malmberg -# Date: 2003-07-29 -# -# This file is part of the GNUstep project. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# You should have received a copy of the GNU General Public -# License along with this library; see the file COPYING.LIB. -# If not, write to the Free Software Foundation, -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# The usage should be fairly obvious. For each pair of OLD_DIR and NEW_DIR, -# make a copy and set OLD_DIR, NEW_DIR, and LIST. Note that LIST must be -# non-empty; if there are no files for a pair, remove it completely. - -after-install:: - @echo Installing compatibility headers... - - @OLD_DIR=Foundation; NEW_DIR=GNUstepBase; \ - LIST="GSXML.h GSMime.h" ;\ - $(MKDIRS) $(GNUSTEP_HEADERS)/$$OLD_DIR; \ - for I in $$LIST ; do \ - (echo "#warning $$I is now included using the path <$$NEW_DIR/$$I>";\ - echo "#include <$$NEW_DIR/$$I>" ) \ - > $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ - done - - @OLD_DIR=gnustep/unicode; NEW_DIR=GNUstepBase/unicode; \ - LIST="caseconv.h cop.h cyrillic.h latin2.h decomp.h nextstep.h" ;\ - $(MKDIRS) $(GNUSTEP_HEADERS)/$$OLD_DIR; \ - for I in $$LIST ; do \ - (echo "#warning $$I is now included using the path <$$NEW_DIR/$$I>";\ - echo "#include <$$NEW_DIR/$$I>" ) \ - > $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I;\ - done - - @OLD_DIR=gnustep/base; NEW_DIR=GNUstepBase; \ - LIST="$(GNU_HEADERS)" ;\ - $(MKDIRS) $(GNUSTEP_HEADERS)/$$OLD_DIR; \ - for I in $$LIST ; do \ - (echo "#warning $$I is now included using the path <$$NEW_DIR/$$I>";\ - echo "#include <$$NEW_DIR/$$I>" ) \ - > $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ - done - - -before-uninstall:: - -@OLD_DIR=Foundation; NEW_DIR=GNUstepBase; \ - LIST="GSXML.h GSMime.h" ;\ - for I in $$LIST ; do \ - rm -f $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ - done; - - -@OLD_DIR=gnustep/unicode; NEW_DIR=GNUstepBase/unicode; \ - LIST="caseconv.h cop.h cyrillic.h latin2.h decomp.h nextstep.h" ;\ - for I in $$LIST ; do \ - rm -f $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ - done; \ - rmdir $(GNUSTEP_HEADERS)/$$OLD_DIR - - -@OLD_DIR=gnustep/base; NEW_DIR=GNUstepBase; \ - LIST="$(GNU_HEADERS)" ;\ - for I in $$LIST ; do \ - rm -f $(GNUSTEP_HEADERS)/$$OLD_DIR/$$I; \ - done; \ - rmdir $(GNUSTEP_HEADERS)/$$OLD_DIR; \ - rmdir $(GNUSTEP_HEADERS)/gnustep diff --git a/Source/GNUmakefile b/Source/GNUmakefile index 7b04d39ea..8787ecee3 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -484,7 +484,6 @@ HEADERS_INSTALL = \ GENERATED_HFILES = \ dynamic-load.h \ $(GNUSTEP_TARGET_DIR)/config.h \ -$(GNUSTEP_TARGET_DIR)/common.h \ $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h @@ -543,4 +542,3 @@ include $(GNUSTEP_MAKEFILES)/resource-set.make -include Makefile.postamble -include CompatibilityHeaders.make diff --git a/Source/Makefile.postamble b/Source/Makefile.postamble index bd911c75a..e5ad0bfbe 100644 --- a/Source/Makefile.postamble +++ b/Source/Makefile.postamble @@ -55,18 +55,14 @@ after-install:: $(GNUSTEP_HEADERS)/ObjectiveC2/objc/$$file ; \ done endif -# Unfortunately the way the header files are placed in relationship -# to the source we must install the GNU header manually -# Ayers 2003-07-31: This statement should be reevaluated! after-install:: $(MKDIRS) $(GNUSTEP_HEADERS)/GNUstepBase for file in $(GNUSTEPBASE_HEADERS); do \ $(INSTALL_DATA) ../Headers/GNUstepBase/$$file \ - $(GNUSTEP_HEADERS)/GNUstepBase/$$file ; \ + $(GNUSTEP_HEADERS)/GNUstepBase/$$file ; \ done - $(MKDIRS) $(GNUSTEP_HEADERS)/$(GNUSTEP_TARGET_DIR)/GNUstepBase $(INSTALL_DATA) $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h \ - $(GNUSTEP_HEADERS)/$(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h + $(GNUSTEP_HEADERS)/GNUstepBase/GSConfig.h if [ "$(DESTDIR)" = "" ]; then \ services=/etc/services; \ if [ "`$(WHOAMI)`" != root ]; then \ @@ -109,6 +105,8 @@ after-clean:: # Things to do after distcleaning after-distclean:: + rm -f $(GNUSTEP_TARGET_DIR)/config.h + rm -f $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h # rm -rf $(GNUSTEP_TARGET_DIR) # Things to do before checking @@ -122,23 +120,20 @@ dynamic-load.h: ../config.status cp $(DYNAMIC_LINKER)-load.h dynamic-load.h # -# The config.h file is specific to a target +# The following header files are specific to a target, so to enable multiple +# builds in the same directory, we copy them to a target-specific subdirectory +# which will be found by the compiler first when compiling for that target # +ifneq ($(GNUSTEP_TARGET_DIR),.) $(GNUSTEP_TARGET_DIR)/config.h: ../config.status $(MKDIRS) $(GNUSTEP_TARGET_DIR) - -mv $(HEADER_DIR_BASE)/config.h $(GNUSTEP_TARGET_DIR) + -cp $(HEADER_DIR_BASE)/config.h $(GNUSTEP_TARGET_DIR) -touch $(GNUSTEP_TARGET_DIR)/config.h $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h: ../config.status $(MKDIRS) $(GNUSTEP_TARGET_DIR)/GNUstepBase - -mv $(HEADER_DIR_BASE)/GSConfig.h $(GNUSTEP_TARGET_DIR)/GNUstepBase + -cp $(HEADER_DIR_BASE)/GSConfig.h $(GNUSTEP_TARGET_DIR)/GNUstepBase -touch $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h - -ifneq ($(GNUSTEP_TARGET_DIR),.) -$(GNUSTEP_TARGET_DIR)/common.h: common.h - $(MKDIRS) $(GNUSTEP_TARGET_DIR) - cp common.h $(GNUSTEP_TARGET_DIR)/common.h - -touch $(GNUSTEP_TARGET_DIR)/common.h endif # diff --git a/Source/Makefile.preamble b/Source/Makefile.preamble index f9156a55f..be5f929d8 100644 --- a/Source/Makefile.preamble +++ b/Source/Makefile.preamble @@ -89,8 +89,7 @@ endif # Additional directories to be created during installation ADDITIONAL_INSTALL_DIRS = $(GNUSTEP_HEADERS)/Foundation \ - $(GNUSTEP_HEADERS)/GNUstepBase/unicode \ - $(GNUSTEP_HEADERS)/$(GNUSTEP_TARGET_DIR) + $(GNUSTEP_HEADERS)/GNUstepBase \ HEADER_DIR_BASE = ../Headers/GNUstepBase HEADER_DIR_FND = ../Headers/Foundation diff --git a/Source/ObjectiveC2/Makefile.preamble b/Source/ObjectiveC2/Makefile.preamble index aa7390fef..68a737556 100644 --- a/Source/ObjectiveC2/Makefile.preamble +++ b/Source/ObjectiveC2/Makefile.preamble @@ -57,7 +57,6 @@ endif ADDITIONAL_CFLAGS = # Additional include directories the compiler should search -# FIXME - the -I../ is for GSPrivate.h ADDITIONAL_INCLUDE_DIRS = -I../$(GNUSTEP_TARGET_DIR) -I../ -I../../Headers # Additional LDFLAGS to pass to the linker diff --git a/Source/unix/Makefile.preamble b/Source/unix/Makefile.preamble index 5464f1704..3e6b90bc1 100644 --- a/Source/unix/Makefile.preamble +++ b/Source/unix/Makefile.preamble @@ -57,7 +57,7 @@ endif ADDITIONAL_CFLAGS = # Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS = -I../$(GNUSTEP_TARGET_DIR) +ADDITIONAL_INCLUDE_DIRS = -I../$(GNUSTEP_TARGET_DIR) -I../ ifeq ($(FOUNDATION_LIB),gnu) ADDITIONAL_INCLUDE_DIRS += -I../../Headers diff --git a/Source/win32/Makefile.preamble b/Source/win32/Makefile.preamble index 5464f1704..3e6b90bc1 100644 --- a/Source/win32/Makefile.preamble +++ b/Source/win32/Makefile.preamble @@ -57,7 +57,7 @@ endif ADDITIONAL_CFLAGS = # Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS = -I../$(GNUSTEP_TARGET_DIR) +ADDITIONAL_INCLUDE_DIRS = -I../$(GNUSTEP_TARGET_DIR) -I../ ifeq ($(FOUNDATION_LIB),gnu) ADDITIONAL_INCLUDE_DIRS += -I../../Headers diff --git a/Tests/base/NSRunLoop/dispatch.m b/Tests/base/NSRunLoop/dispatch.m index ba14b8490..8f5b2727c 100644 --- a/Tests/base/NSRunLoop/dispatch.m +++ b/Tests/base/NSRunLoop/dispatch.m @@ -1,14 +1,14 @@ #import "ObjectTesting.h" -#import -#import -#import -#import -#import "../../../Source/config.h" +#import "Foundation/NSAutoreleasePool.h" +#import "Foundation/NSThread.h" +#import "Foundation/NSTimer.h" +#import "Foundation/NSRunLoop.h" +#import "GNUstepBase/GSConfig.h" const NSTimeInterval kDelay = 0.01; -#if HAVE_DISPATCH_GET_MAIN_QUEUE_HANDLE_NP && HAVE_DISPATCH_MAIN_QUEUE_DRAIN_NP && __has_feature(blocks) +#if HAVE_LIBDISPATCH_RUNLOOP && __has_feature(blocks) # define DISPATCH_RL_INTEGRATION 1 # ifdef HAVE_DISPATCH_H # include diff --git a/Tools/Makefile.preamble b/Tools/Makefile.preamble index 980482a1f..941cd1ab0 100644 --- a/Tools/Makefile.preamble +++ b/Tools/Makefile.preamble @@ -49,7 +49,7 @@ endif #ADDITIONAL_CFLAGS += # Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS += -I../Source/$(GNUSTEP_TARGET_DIR) +ADDITIONAL_INCLUDE_DIRS += -I../Source/$(GNUSTEP_TARGET_DIR) -I../Source/ ifeq ($(FOUNDATION_LIB),gnu) ADDITIONAL_INCLUDE_DIRS += -I../Headers diff --git a/Tools/make_strings/GNUmakefile.preamble b/Tools/make_strings/GNUmakefile.preamble index f087d7a80..6fbf6464b 100644 --- a/Tools/make_strings/GNUmakefile.preamble +++ b/Tools/make_strings/GNUmakefile.preamble @@ -46,7 +46,7 @@ ADDITIONAL_OBJCFLAGS += $(WARN_FLAGS) #ADDITIONAL_CFLAGS += # Additional include directories the compiler should search -ADDITIONAL_INCLUDE_DIRS += -I../../Source/$(GNUSTEP_TARGET_DIR) +ADDITIONAL_INCLUDE_DIRS += -I../../Source/$(GNUSTEP_TARGET_DIR) -I../../Source/ ifeq ($(FOUNDATION_LIB),gnu) ADDITIONAL_INCLUDE_DIRS += -I../../Headers diff --git a/config.mak.in b/config.mak.in index 8f3c38400..7f83c1cc4 100644 --- a/config.mak.in +++ b/config.mak.in @@ -41,6 +41,7 @@ GNUSTEP_BASE_HAVE_MDNS=@HAVE_MDNS@ GNUSTEP_BASE_HAVE_AVAHI=@HAVE_AVAHI@ GNUSTEP_BASE_HAVE_ICU=@HAVE_ICU@ GNUSTEP_BASE_HAVE_LIBDISPATCH=@HAVE_LIBDISPATCH@ +GNUSTEP_BASE_HAVE_LIBDISPATCH_RUNLOOP=@HAVE_LIBDISPATCH_RUNLOOP@ # Default to building only -baseadd # on non *-gnu-* library combos diff --git a/config/objc-common.g b/config/objc-common.g index c23304f6b..b5e34ba00 100644 --- a/config/objc-common.g +++ b/config/objc-common.g @@ -16,13 +16,6 @@ #include #endif - -#if HAVE_OBJC_ROOT_CLASS_ATTRIBUTE -#define GS_OBJC_ROOT_CLASS __attribute__((objc_root_class)) -#else -#define GS_OBJC_ROOT_CLASS -#endif - /* Provide an implementation of NXConstantString for an old libobjc when built stand-alone without an NXConstantString implementation. */ #if !defined(NeXT_RUNTIME) && !defined(__GNUSTEP_RUNTIME__) @@ -38,6 +31,14 @@ @end #endif +#if !defined(__APPLE__) + +#if HAVE_OBJC_ROOT_CLASS_ATTRIBUTE +#define GS_OBJC_ROOT_CLASS __attribute__((objc_root_class)) +#else +#define GS_OBJC_ROOT_CLASS +#endif + /* Provide dummy implementations for NSObject and NSConstantString * for libobjc2 which needs them. */ @@ -63,3 +64,5 @@ GS_OBJC_ROOT_CLASS @interface NSObject @end @implementation NSConstantString @end +#endif /* __APPLE__ */ + diff --git a/configure b/configure index aa9cd70fd..302407a24 100755 --- a/configure +++ b/configure @@ -632,6 +632,7 @@ WARN_FLAGS LDIR_FLAGS INCLUDE_FLAGS USE_GMP +HAVE_LIBDISPATCH_RUNLOOP HAVE_LIBDISPATCH HAVE_ICU ICU_LIBS @@ -12351,6 +12352,7 @@ $as_echo "no" >&6; }; fi +HAVE_LIBDISPATCH_RUNLOOP=0 if test $HAVE_LIBDISPATCH = 1; then # We check whether we have a variant of libdispatch that allows runloop # integration @@ -12366,8 +12368,15 @@ _ACEOF fi done + if test "$ac_cv_func_dispatch_main_queue_drain_np" = "no"; then + HAVE_LIBDISPATCH_RUNLOOP=1 + fi + if test "$ac_cv_func_dispatch_get_main_queue_handle_np" = "no"; then + HAVE_LIBDISPATCH_RUNLOOP=1 + fi fi + #-------------------------------------------------------------------- # Check GMP for NSDecimal #-------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 1c80f6f4e..200cd90bb 100644 --- a/configure.ac +++ b/configure.ac @@ -56,7 +56,7 @@ # In addition the values should be substituted into the header file # Headers/GNUstepBase/GSConfig.h.in so that it can define a # preprocessor constant of the form GS_USE_XXX to 1 or 0, providing a -# standard mechanism for parts of a paritcvular file to compile to make +# standard mechanism for parts of a particular file to compile to make # use of the external code or not. # This file is included by all the base library source code, and may also # be included by code which uses the base library. @@ -3387,11 +3387,19 @@ if test $enable_libdispatch = yes; then fi AC_SUBST(HAVE_LIBDISPATCH) +HAVE_LIBDISPATCH_RUNLOOP=0 if test $HAVE_LIBDISPATCH = 1; then # We check whether we have a variant of libdispatch that allows runloop # integration AC_CHECK_FUNCS(dispatch_main_queue_drain_np dispatch_get_main_queue_handle_np) + if test "$ac_cv_func_dispatch_main_queue_drain_np" = "no"; then + HAVE_LIBDISPATCH_RUNLOOP=1 + fi + if test "$ac_cv_func_dispatch_get_main_queue_handle_np" = "no"; then + HAVE_LIBDISPATCH_RUNLOOP=1 + fi fi +AC_SUBST(HAVE_LIBDISPATCH_RUNLOOP) #-------------------------------------------------------------------- # Check GMP for NSDecimal