Previous: , Up: Top   [Contents]


1.8 Other Variables

Since gnustep-make is a system of scripts rather than compiled code, all the source is always present and available to read, so the main documentation is intentionally provided as comments within that source.

In particular, gnustep-make variables are documented at the head of the project-type files in which they are used. eg $GNUSTEP_MAKEFILES/Instance/library.make for the variables used to build a library.

However, there are some variables which, while not in provided in common.make are of more general use, and therefore may reasonably be documented here:

Variable: GS_WITH_ARC

GS_WITH_ARC may be set to 1 to turns on ARC for the current build if using the Next Generation runtime setting. This variable may be defined as an environment variable, or on the make command line, or (usually) in the GNUmakefile. The library-combo needs to specify the next generation runtime (eg ng-gnu-gnu) for this variable to take effect. When the ng runtme is used, setting this variable causes the the flags specified in ARC_OBJCFLAGS to be used when compiling any Objective-C source files). If no value is defined for ARC_OBJCFLAGS it is assumed to be ’-fobjc-arc -fobjc-arc-exceptions’ so that code is built with ARC enabled and with support for exceptions (objects are not leaked when an exception occurs). Alternatively, to switch on ARC for individual files, you can have a makefile fragment like this:

ifeq ($(OBJC_RUNTIME_LIB), ng)
file1.m_FILE_FLAGS += -DGS_WITH_ARC=1 -fobjc-arc -fobjc-arc-exceptions
file2.m_FILE_FLAGS += -DGS_WITH_ARC=1 -fobjc-arc -fobjc-arc-exceptions
file9.m_FILE_FLAGS += -DGS_WITH_ARC=1 -fobjc-arc -fobjc-arc-exceptions
endif
Variable: ARC_CPPFLAGS

ARC_CPPFLAGS sets the flags to defien preprocessor values be used when building code for ARC. This variable is used only if ng runtime is used and the GS_WITH_ARC variable is set to say that ARC is used.

Variable: ARC_OBJCFLAGS

ARC_OBJCFLAGS sets the compiler/linker flags to be used when building code for ARC. This variable is used only if ng runtime is used and the ’GS_WITH_ARC’ variable is set to say that ARC is used. The -fobjc-arc flag enables ARC, but by default ARC_OBJCFLAGS is assumed to be -fobjc-arc -fobjc-arc-exceptions, which adds support for exceptions (reducing performance, but preventing leaked memory when an exception occurs).

Variable: xxx_FILE_FILTER_OUT_FLAGS

xxx_FILE_FILTER_OUT_FLAGS (where xxx is the file name, such as mframe.m) is a filter-out make pattern of flags to be filtered out from the compilation flags when compiling xxx. In exceptional conditions, you might need to want to use different compiler flags for a file (for example, if a file doesn’t compile with optimization turned on, you might want to compile that single file with optimizations turned off).

file.m_FILE_FILTER_OUT_FLAGS = -O% -fomit-frame-pointer

This says that when compiling file.m we should disable optimization flags, and also remove frame pointer information.

Variable: xxx_FILE_FLAGS

xxx_FILE_FLAGS (where xxx is the file name, such as main.m) add special compilation flags to be used when compiling xxx. In exceptional conditions, you might need to want to use different compiler flags for a file (for example, if ou want to turn on automated reference counting for that file)

file.m_FILE_FLAGS = -fobjc-arc

This says that when compiling file.m we should turn on ARC.


Previous: , Up: Top   [Contents]