Various configure/build tweaks

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40062 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-08-19 12:20:24 +00:00
parent 116e5f8211
commit 33ed35331b
17 changed files with 73 additions and 119 deletions

View file

@ -1,3 +1,25 @@
2016-08-19 Richard Frith-Macdonald <rfm@gnu.org>
* 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 <niels.grewe@halbordnung.de> 2016-07-27 Niels Grewe <niels.grewe@halbordnung.de>
* Header/Foundation/NSData.h * Header/Foundation/NSData.h

View file

@ -269,6 +269,7 @@ typedef struct {
#define GS_USE_MDNS @HAVE_MDNS@ #define GS_USE_MDNS @HAVE_MDNS@
#define GS_USE_ICU @HAVE_ICU@ #define GS_USE_ICU @HAVE_ICU@
#define GS_USE_LIBDISPATCH @HAVE_LIBDISPATCH@ #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@ #define GS_HAVE_OBJC_ROOT_CLASS_ATTR @GS_HAVE_OBJC_ROOT_CLASS_ATTR@
#ifndef __has_include #ifndef __has_include

View file

@ -58,7 +58,6 @@ endif
ADDITIONAL_CFLAGS = ADDITIONAL_CFLAGS =
# Additional include directories the compiler should search # Additional include directories the compiler should search
# FIXME - the -I../ is for GSPrivate.h
ADDITIONAL_INCLUDE_DIRS = -I../$(GNUSTEP_TARGET_DIR) -I../ ADDITIONAL_INCLUDE_DIRS = -I../$(GNUSTEP_TARGET_DIR) -I../
# We include the main base Headers if we are building using the base library # We include the main base Headers if we are building using the base library

View file

@ -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 <alexander@malmberg.org>
# 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

View file

@ -484,7 +484,6 @@ HEADERS_INSTALL = \
GENERATED_HFILES = \ GENERATED_HFILES = \
dynamic-load.h \ dynamic-load.h \
$(GNUSTEP_TARGET_DIR)/config.h \ $(GNUSTEP_TARGET_DIR)/config.h \
$(GNUSTEP_TARGET_DIR)/common.h \
$(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h
@ -543,4 +542,3 @@ include $(GNUSTEP_MAKEFILES)/resource-set.make
-include Makefile.postamble -include Makefile.postamble
include CompatibilityHeaders.make

View file

@ -55,18 +55,14 @@ after-install::
$(GNUSTEP_HEADERS)/ObjectiveC2/objc/$$file ; \ $(GNUSTEP_HEADERS)/ObjectiveC2/objc/$$file ; \
done done
endif 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:: after-install::
$(MKDIRS) $(GNUSTEP_HEADERS)/GNUstepBase $(MKDIRS) $(GNUSTEP_HEADERS)/GNUstepBase
for file in $(GNUSTEPBASE_HEADERS); do \ for file in $(GNUSTEPBASE_HEADERS); do \
$(INSTALL_DATA) ../Headers/GNUstepBase/$$file \ $(INSTALL_DATA) ../Headers/GNUstepBase/$$file \
$(GNUSTEP_HEADERS)/GNUstepBase/$$file ; \ $(GNUSTEP_HEADERS)/GNUstepBase/$$file ; \
done done
$(MKDIRS) $(GNUSTEP_HEADERS)/$(GNUSTEP_TARGET_DIR)/GNUstepBase
$(INSTALL_DATA) $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h \ $(INSTALL_DATA) $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h \
$(GNUSTEP_HEADERS)/$(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h $(GNUSTEP_HEADERS)/GNUstepBase/GSConfig.h
if [ "$(DESTDIR)" = "" ]; then \ if [ "$(DESTDIR)" = "" ]; then \
services=/etc/services; \ services=/etc/services; \
if [ "`$(WHOAMI)`" != root ]; then \ if [ "`$(WHOAMI)`" != root ]; then \
@ -109,6 +105,8 @@ after-clean::
# Things to do after distcleaning # Things to do after distcleaning
after-distclean:: after-distclean::
rm -f $(GNUSTEP_TARGET_DIR)/config.h
rm -f $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h
# rm -rf $(GNUSTEP_TARGET_DIR) # rm -rf $(GNUSTEP_TARGET_DIR)
# Things to do before checking # Things to do before checking
@ -122,23 +120,20 @@ dynamic-load.h: ../config.status
cp $(DYNAMIC_LINKER)-load.h dynamic-load.h 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 $(GNUSTEP_TARGET_DIR)/config.h: ../config.status
$(MKDIRS) $(GNUSTEP_TARGET_DIR) $(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 -touch $(GNUSTEP_TARGET_DIR)/config.h
$(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h: ../config.status $(GNUSTEP_TARGET_DIR)/GNUstepBase/GSConfig.h: ../config.status
$(MKDIRS) $(GNUSTEP_TARGET_DIR)/GNUstepBase $(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 -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 endif
# #

View file

@ -89,8 +89,7 @@ endif
# Additional directories to be created during installation # Additional directories to be created during installation
ADDITIONAL_INSTALL_DIRS = $(GNUSTEP_HEADERS)/Foundation \ ADDITIONAL_INSTALL_DIRS = $(GNUSTEP_HEADERS)/Foundation \
$(GNUSTEP_HEADERS)/GNUstepBase/unicode \ $(GNUSTEP_HEADERS)/GNUstepBase \
$(GNUSTEP_HEADERS)/$(GNUSTEP_TARGET_DIR)
HEADER_DIR_BASE = ../Headers/GNUstepBase HEADER_DIR_BASE = ../Headers/GNUstepBase
HEADER_DIR_FND = ../Headers/Foundation HEADER_DIR_FND = ../Headers/Foundation

View file

@ -57,7 +57,6 @@ endif
ADDITIONAL_CFLAGS = ADDITIONAL_CFLAGS =
# Additional include directories the compiler should search # 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_INCLUDE_DIRS = -I../$(GNUSTEP_TARGET_DIR) -I../ -I../../Headers
# Additional LDFLAGS to pass to the linker # Additional LDFLAGS to pass to the linker

View file

@ -57,7 +57,7 @@ endif
ADDITIONAL_CFLAGS = ADDITIONAL_CFLAGS =
# Additional include directories the compiler should search # 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) ifeq ($(FOUNDATION_LIB),gnu)
ADDITIONAL_INCLUDE_DIRS += -I../../Headers ADDITIONAL_INCLUDE_DIRS += -I../../Headers

View file

@ -57,7 +57,7 @@ endif
ADDITIONAL_CFLAGS = ADDITIONAL_CFLAGS =
# Additional include directories the compiler should search # 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) ifeq ($(FOUNDATION_LIB),gnu)
ADDITIONAL_INCLUDE_DIRS += -I../../Headers ADDITIONAL_INCLUDE_DIRS += -I../../Headers

View file

@ -1,14 +1,14 @@
#import "ObjectTesting.h" #import "ObjectTesting.h"
#import <Foundation/NSAutoreleasePool.h> #import "Foundation/NSAutoreleasePool.h"
#import <Foundation/NSThread.h> #import "Foundation/NSThread.h"
#import <Foundation/NSTimer.h> #import "Foundation/NSTimer.h"
#import <Foundation/NSRunLoop.h> #import "Foundation/NSRunLoop.h"
#import "../../../Source/config.h" #import "GNUstepBase/GSConfig.h"
const NSTimeInterval kDelay = 0.01; 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 # define DISPATCH_RL_INTEGRATION 1
# ifdef HAVE_DISPATCH_H # ifdef HAVE_DISPATCH_H
# include <dispatch.h> # include <dispatch.h>

View file

@ -49,7 +49,7 @@ endif
#ADDITIONAL_CFLAGS += #ADDITIONAL_CFLAGS +=
# Additional include directories the compiler should search # 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) ifeq ($(FOUNDATION_LIB),gnu)
ADDITIONAL_INCLUDE_DIRS += -I../Headers ADDITIONAL_INCLUDE_DIRS += -I../Headers

View file

@ -46,7 +46,7 @@ ADDITIONAL_OBJCFLAGS += $(WARN_FLAGS)
#ADDITIONAL_CFLAGS += #ADDITIONAL_CFLAGS +=
# Additional include directories the compiler should search # 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) ifeq ($(FOUNDATION_LIB),gnu)
ADDITIONAL_INCLUDE_DIRS += -I../../Headers ADDITIONAL_INCLUDE_DIRS += -I../../Headers

View file

@ -41,6 +41,7 @@ GNUSTEP_BASE_HAVE_MDNS=@HAVE_MDNS@
GNUSTEP_BASE_HAVE_AVAHI=@HAVE_AVAHI@ GNUSTEP_BASE_HAVE_AVAHI=@HAVE_AVAHI@
GNUSTEP_BASE_HAVE_ICU=@HAVE_ICU@ GNUSTEP_BASE_HAVE_ICU=@HAVE_ICU@
GNUSTEP_BASE_HAVE_LIBDISPATCH=@HAVE_LIBDISPATCH@ GNUSTEP_BASE_HAVE_LIBDISPATCH=@HAVE_LIBDISPATCH@
GNUSTEP_BASE_HAVE_LIBDISPATCH_RUNLOOP=@HAVE_LIBDISPATCH_RUNLOOP@
# Default to building only -baseadd # Default to building only -baseadd
# on non *-gnu-* library combos # on non *-gnu-* library combos

View file

@ -16,13 +16,6 @@
#include <objc/hooks.h> #include <objc/hooks.h>
#endif #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 /* Provide an implementation of NXConstantString for an old libobjc when
built stand-alone without an NXConstantString implementation. */ built stand-alone without an NXConstantString implementation. */
#if !defined(NeXT_RUNTIME) && !defined(__GNUSTEP_RUNTIME__) #if !defined(NeXT_RUNTIME) && !defined(__GNUSTEP_RUNTIME__)
@ -38,6 +31,14 @@
@end @end
#endif #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 /* Provide dummy implementations for NSObject and NSConstantString
* for libobjc2 which needs them. * for libobjc2 which needs them.
*/ */
@ -63,3 +64,5 @@ GS_OBJC_ROOT_CLASS @interface NSObject
@end @end
@implementation NSConstantString @implementation NSConstantString
@end @end
#endif /* __APPLE__ */

9
configure vendored
View file

@ -632,6 +632,7 @@ WARN_FLAGS
LDIR_FLAGS LDIR_FLAGS
INCLUDE_FLAGS INCLUDE_FLAGS
USE_GMP USE_GMP
HAVE_LIBDISPATCH_RUNLOOP
HAVE_LIBDISPATCH HAVE_LIBDISPATCH
HAVE_ICU HAVE_ICU
ICU_LIBS ICU_LIBS
@ -12351,6 +12352,7 @@ $as_echo "no" >&6; };
fi fi
HAVE_LIBDISPATCH_RUNLOOP=0
if test $HAVE_LIBDISPATCH = 1; then if test $HAVE_LIBDISPATCH = 1; then
# We check whether we have a variant of libdispatch that allows runloop # We check whether we have a variant of libdispatch that allows runloop
# integration # integration
@ -12366,8 +12368,15 @@ _ACEOF
fi fi
done 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 fi
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Check GMP for NSDecimal # Check GMP for NSDecimal
#-------------------------------------------------------------------- #--------------------------------------------------------------------

View file

@ -56,7 +56,7 @@
# In addition the values should be substituted into the header file # In addition the values should be substituted into the header file
# Headers/GNUstepBase/GSConfig.h.in so that it can define a # 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 # 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. # use of the external code or not.
# This file is included by all the base library source code, and may also # This file is included by all the base library source code, and may also
# be included by code which uses the base library. # be included by code which uses the base library.
@ -3387,11 +3387,19 @@ if test $enable_libdispatch = yes; then
fi fi
AC_SUBST(HAVE_LIBDISPATCH) AC_SUBST(HAVE_LIBDISPATCH)
HAVE_LIBDISPATCH_RUNLOOP=0
if test $HAVE_LIBDISPATCH = 1; then if test $HAVE_LIBDISPATCH = 1; then
# We check whether we have a variant of libdispatch that allows runloop # We check whether we have a variant of libdispatch that allows runloop
# integration # integration
AC_CHECK_FUNCS(dispatch_main_queue_drain_np dispatch_get_main_queue_handle_np) 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 fi
AC_SUBST(HAVE_LIBDISPATCH_RUNLOOP)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Check GMP for NSDecimal # Check GMP for NSDecimal