Generate pkg-config configuration file for libs-base

This commit generates a `gnustep-base.pc` file which is installed in `/lib/pkgconfig` and contains the GNUstep base version number, the libraries to link (equivalent to `gnustep-config --base-libs`) with and the C flags to use (equivalent to `gnustep-config --objc-flags`).
This commit is contained in:
Frederik Carlier 2024-03-27 12:30:41 +00:00 committed by Ivan Vučica
parent 61da0dab96
commit 07d17a16a7
5 changed files with 21 additions and 2 deletions

1
.gitignore vendored
View file

@ -9,6 +9,7 @@ Tests/base/*/GNUmakefile
*.log
*.sum
Tools/BaseTools/dependencies
Source/gnustep-base.pc
# Unit test byproducts
*.err

View file

@ -639,6 +639,7 @@ libbase-resources_RESOURCE_FILES = Info-gnustep.plist
libgnustep-base_NEEDS_GUI = NO
libgnustep-baseadd_NEEDS_GUI = NO
libgnustep-base_PKGCONFIG_FILES = "gnustep-base.pc"
# Build the Additions subproject first. It can then be used in by
# both gnustep-base and gnustep-baseadd (otherwise, if we ever build

View file

@ -0,0 +1,6 @@
Name: gnustep-base
Description: The GNUstep Base Library is a library of general-purpose, non-graphical Objective C objects.
Version: @VERSION@
URL: https://github.com/gnustep/libs-base/
Libs: @BASELIBS@
Cflags: @BASEFLAGS@

10
configure vendored
View file

@ -750,6 +750,8 @@ build_os
build_vendor
build_cpu
build
BASELIBS
BASEFLAGS
BASE_NONFRAGILE_ABI
target_alias
host_alias
@ -2801,6 +2803,11 @@ $as_echo "$as_me: WARNING: You are running configure with the link options ($LDF
fi
fi
BASEFLAGS=`gnustep-config --objc-flags`
BASELIBS=`gnustep-config --base-libs`
# We shouldn't be loading GNUstep.sh here. It would load in a lot of
# variables which might get confused with the ones that will be used
# at runtime. We will load it later once we have determined (and
@ -14161,7 +14168,7 @@ $as_echo "$VERSION" >&6; }
#--------------------------------------------------------------------
# Write the Makefiles
#--------------------------------------------------------------------
ac_config_files="$ac_config_files config.mak base.make Headers/GNUstepBase/GSConfig.h"
ac_config_files="$ac_config_files config.mak base.make Source/gnustep-base.pc Headers/GNUstepBase/GSConfig.h"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -14856,6 +14863,7 @@ do
"Headers/GNUstepBase/config.h") CONFIG_HEADERS="$CONFIG_HEADERS Headers/GNUstepBase/config.h" ;;
"config.mak") CONFIG_FILES="$CONFIG_FILES config.mak" ;;
"base.make") CONFIG_FILES="$CONFIG_FILES base.make" ;;
"Source/gnustep-base.pc") CONFIG_FILES="$CONFIG_FILES Source/gnustep-base.pc" ;;
"Headers/GNUstepBase/GSConfig.h") CONFIG_FILES="$CONFIG_FILES Headers/GNUstepBase/GSConfig.h" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;

View file

@ -126,6 +126,9 @@ else
fi
fi
AC_SUBST(BASEFLAGS, `gnustep-config --objc-flags`)
AC_SUBST(BASELIBS, `gnustep-config --base-libs`)
# We shouldn't be loading GNUstep.sh here. It would load in a lot of
# variables which might get confused with the ones that will be used
# at runtime. We will load it later once we have determined (and
@ -3868,5 +3871,5 @@ AC_SUBST(GCC_VERSION)
#--------------------------------------------------------------------
# Write the Makefiles
#--------------------------------------------------------------------
AC_CONFIG_FILES([config.mak base.make Headers/GNUstepBase/GSConfig.h])
AC_CONFIG_FILES([config.mak base.make Source/gnustep-base.pc Headers/GNUstepBase/GSConfig.h])
AC_OUTPUT