move library combo into m4/

This commit is contained in:
Niels Grewe 2019-12-03 21:41:33 +01:00
parent 114faf5cd8
commit 21c5b37cc9
No known key found for this signature in database
GPG key ID: 003E2A780EE52172
4 changed files with 113 additions and 92 deletions

1
aclocal.m4 vendored
View file

@ -14,3 +14,4 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_include([m4/gs_cc_is_clang.m4])
m4_include([m4/gs_gcc_version.m4])
m4_include([m4/gs_library_combo.m4])

97
configure vendored
View file

@ -1563,28 +1563,31 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-library-combo
Define the default "library combo". The library combo is a string
of the form aaa-bbb-ccc where 'aaa' is the Objective-C runtime
library to use (examples are 'gnu' and 'apple'),
'bbb' is the Foundation library to use (examples are 'gnu' for
gnustep-base, and 'apple' for Apple Cocoa FoundationKit),
and 'ccc' is the ApplicationKit to use (examples are 'gnu'
for gnustep-gui and 'apple' for Apple Cocoa AppKit). Use this
option if you want to force a different default library combo than
the one that would be used by default. For example, on Darwin GNUstep
will automatically use the Apple Objective-C frameworks by
default (library-combo=apple-apple-apple); if you are planning
on installing and using gnustep-base on there, you would need
to use --with-library-combo=gnu-gnu-gnu instead. Please notice
that if --disable-flattened is used, gnustep-make can have fat
binaries that support multiple library combos. In that case,
this flag will only configure the default one, but you can still
use other ones at run-time.
Please use 'ng-gnu-gnu' to build with 'next generation' cutting edge
runtime and compile time featured (requires a recent version of clang).
--with-libray-combo Define the default "library combo". The library
combo is a string of the form aaa-bbb-ccc where
'aaa' is the Objective-C runtime library to use
(examples are 'gnu' and 'apple'), 'bbb' is the
Foundation library to use (examples are 'gnu' for
gnustep-base, and 'apple' for Apple Cocoa
FoundationKit), and 'ccc' is the ApplicationKit to
use (examples are 'gnu' for gnustep-gui and 'apple'
for Apple Cocoa AppKit). Use this option if you want
to force a different default library combo than the
one that would be used by default. For example, on
Darwin GNUstep will automatically use the Apple
Objective-C frameworks by default
(library-combo=apple-apple-apple); if you are
planning on installing and using gnustep-base on
there, you would need to use
--with-library-combo=gnu-gnu-gnu instead. Please
notice that if --disable-flattened is used,
gnustep-make can have fat binaries that support
multiple library combos. In that case, this flag
will only configure the default one, but you can
still use other ones at run-time. Please use
'ng-gnu-gnu' to build with 'next generation' cutting
edge runtime and compile time features (requires a
recent version of clang).
--with-tar
Set the name of the tar program to use. Use this option if the
@ -2463,39 +2466,45 @@ fi
# Setup the library combination
#--------------------------------------------------------------------
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library combo" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library combo" >&5
$as_echo_n "checking for library combo... " >&6; }
if ${_gs_cv_libray_combo+:} false; then :
$as_echo_n "(cached) " >&6
else
case "$host_os" in
darwin*) default_library_combo=apple-apple-apple ;;
nextstep4) default_library_combo=nx-nx-nx ;;
openstep4) default_library_combo=nx-nx-nx ;;
*) default_library_combo=gnu-gnu-gnu ;;
esac
if test ! x"" = x""; then
default_library_combo=""
fi
# Check whether --with-library-combo was given.
if test "${with_library_combo+set}" = set; then :
withval=$with_library_combo; ac_cv_library_combo=$withval
withval=$with_library_combo;
else
ac_cv_library_combo=$ac_cv_library_combo
with_library_combo=${default_library_combo}
fi
case "$with_library_combo" in
apple) with_library_combo=apple-apple-apple ;;
gnu) with_library_combo=gnu-gnu-gnu ;;
ng) with_library_combo=ng-gnu-gnu ;;
nx) with_library_combo=nx-nx-nx ;;
esac
_gs_cv_libray_combo=${with_library_combo}
if test "$ac_cv_library_combo" = "" -o "$ac_cv_library_combo" = "no"; then
case "$host_os" in
darwin*) ac_cv_library_combo=apple-apple-apple ;;
nextstep4) ac_cv_library_combo=nx-nx-nx ;;
openstep4) ac_cv_library_combo=nx-nx-nx ;;
*) ac_cv_library_combo=gnu-gnu-gnu ;;
esac
fi
case "$ac_cv_library_combo" in
apple) ac_cv_library_combo=apple-apple-apple ;;
gnu) ac_cv_library_combo=gnu-gnu-gnu ;;
ng) ac_cv_library_combo=ng-gnu-gnu ;;
nx) ac_cv_library_combo=nx-nx-nx ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gs_cv_libray_combo" >&5
$as_echo "$_gs_cv_libray_combo" >&6; }
ac_cv_library_combo=${_gs_cv_libray_combo}
OBJC_RUNTIME_LIB=${_gs_cv_libray_combo%%-*}
ac_cv_library_combo=${_gs_cv_libray_combo}
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_library_combo" >&5
$as_echo "$ac_cv_library_combo" >&6; }
OBJC_RUNTIME_LIB=`echo $ac_cv_library_combo | awk -F- '{print $1}'`
# The ng runtime library setting requires clang rather than gcc
if test "$OBJC_RUNTIME_LIB" = "ng"; then

View file

@ -49,54 +49,7 @@ AC_PATH_PROG(GNUSTEP_HAS_PKGCONFIG, pkgconfig, yes, no)
#--------------------------------------------------------------------
# Setup the library combination
#--------------------------------------------------------------------
AC_MSG_CHECKING(for library combo)
AC_ARG_WITH(library-combo,[
--with-library-combo
Define the default "library combo". The library combo is a string
of the form aaa-bbb-ccc where 'aaa' is the Objective-C runtime
library to use (examples are 'gnu' and 'apple'),
'bbb' is the Foundation library to use (examples are 'gnu' for
gnustep-base, and 'apple' for Apple Cocoa FoundationKit),
and 'ccc' is the ApplicationKit to use (examples are 'gnu'
for gnustep-gui and 'apple' for Apple Cocoa AppKit). Use this
option if you want to force a different default library combo than
the one that would be used by default. For example, on Darwin GNUstep
will automatically use the Apple Objective-C frameworks by
default (library-combo=apple-apple-apple); if you are planning
on installing and using gnustep-base on there, you would need
to use --with-library-combo=gnu-gnu-gnu instead. Please notice
that if --disable-flattened is used, gnustep-make can have fat
binaries that support multiple library combos. In that case,
this flag will only configure the default one, but you can still
use other ones at run-time.
Please use 'ng-gnu-gnu' to build with 'next generation' cutting edge
runtime and compile time featured (requires a recent version of clang).
],
ac_cv_library_combo=$withval,
ac_cv_library_combo=$ac_cv_library_combo
)
if test "$ac_cv_library_combo" = "" -o "$ac_cv_library_combo" = "no"; then
case "$host_os" in
darwin*) ac_cv_library_combo=apple-apple-apple ;;
nextstep4) ac_cv_library_combo=nx-nx-nx ;;
openstep4) ac_cv_library_combo=nx-nx-nx ;;
*) ac_cv_library_combo=gnu-gnu-gnu ;;
esac
fi
case "$ac_cv_library_combo" in
apple) ac_cv_library_combo=apple-apple-apple ;;
gnu) ac_cv_library_combo=gnu-gnu-gnu ;;
ng) ac_cv_library_combo=ng-gnu-gnu ;;
nx) ac_cv_library_combo=nx-nx-nx ;;
esac
AC_SUBST(ac_cv_library_combo)
AC_MSG_RESULT($ac_cv_library_combo)
OBJC_RUNTIME_LIB=`echo $ac_cv_library_combo | awk -F- '{print $1}'`
GS_LIBRARY_COMBO()
# The ng runtime library setting requires clang rather than gcc
if test "$OBJC_RUNTIME_LIB" = "ng"; then

58
m4/gs_library_combo.m4 Normal file
View file

@ -0,0 +1,58 @@
# SYNOPSIS
#
# GS_LIBRARY_COMBO([default_library_combo])
#
# DESCRIPTION
#
# This macro installs the library combo configuration by setting the following:
#
# * The makefile variable `ac_cv_library_combo'
# * The variables `OBJC_RUNTIME_LIB' and `ac_cv_library_combo'
#
AC_DEFUN([GS_LIBRARY_COMBO],dnl
[AC_REQUIRE([AC_CANONICAL_TARGET])
AC_CACHE_CHECK([for library combo],[_gs_cv_libray_combo], [
case "$host_os" in
darwin*) default_library_combo=apple-apple-apple ;;
nextstep4) default_library_combo=nx-nx-nx ;;
openstep4) default_library_combo=nx-nx-nx ;;
*) default_library_combo=gnu-gnu-gnu ;;
esac
if test ! x"$1" = x""; then
default_library_combo="$1"
fi
AC_ARG_WITH([library-combo],
[AS_HELP_STRING([--with-libray-combo], [
Define the default "library combo". The library combo is a string
of the form aaa-bbb-ccc where 'aaa' is the Objective-C runtime
library to use (examples are 'gnu' and 'apple'),
'bbb' is the Foundation library to use (examples are 'gnu' for
gnustep-base, and 'apple' for Apple Cocoa FoundationKit),
and 'ccc' is the ApplicationKit to use (examples are 'gnu'
for gnustep-gui and 'apple' for Apple Cocoa AppKit). Use this
option if you want to force a different default library combo than
the one that would be used by default. For example, on Darwin GNUstep
will automatically use the Apple Objective-C frameworks by
default (library-combo=apple-apple-apple); if you are planning
on installing and using gnustep-base on there, you would need
to use --with-library-combo=gnu-gnu-gnu instead. Please notice
that if --disable-flattened is used, gnustep-make can have fat
binaries that support multiple library combos. In that case,
this flag will only configure the default one, but you can still
use other ones at run-time.
Please use 'ng-gnu-gnu' to build with 'next generation' cutting edge
runtime and compile time features (requires a recent version of clang).
])],,
[with_library_combo=]${default_library_combo})
case "$with_library_combo" in
apple) with_library_combo=apple-apple-apple ;;
gnu) with_library_combo=gnu-gnu-gnu ;;
ng) with_library_combo=ng-gnu-gnu ;;
nx) with_library_combo=nx-nx-nx ;;
esac
_gs_cv_libray_combo=${with_library_combo}
])
AS_VAR_SET([ac_cv_library_combo], [${_gs_cv_libray_combo}])
AS_VAR_SET([OBJC_RUNTIME_LIB], [${_gs_cv_libray_combo%%-*}])
AC_SUBST([ac_cv_library_combo], [${_gs_cv_libray_combo}])
])