This commits updates the libs-gui build process to generate a gnustep-gui.pc file which is installed in /lib/pkgconfig and contains the GNUstep gui version number, the libraries to link (equivalent to gnustep-config --gui-libs) with and the C flags to use (equivalent to gnustep-config --objc-flags). (#246)

This can be useful when linking with libs-gui in projects which don't use the GNUstep build system.
This commit is contained in:
Frederik Carlier 2024-03-27 23:39:23 +01:00 committed by GitHub
parent c12fdd26f7
commit 2372b76cc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 29 additions and 2 deletions

1
.gitignore vendored
View file

@ -13,6 +13,7 @@ gnustep-gui-debug.spec
gui.make
Headers/Additions/GNUstepGUI/GSVersion.h
Source/config.h
Source/gnustep-gui.pc
Source/Info-gnustep.plist
Tests/gui/*/GNUmakefile
Tools/speech/GSSpeechServer.app

View file

@ -701,6 +701,9 @@ libgui-resources_RESOURCE_FILES = Info-gnustep.plist
# Extra DLL exports file
libgnustep-gui_DLL_DEF = libgnustep-gui.def
# pkg-config file
libgnustep-gui_PKGCONFIG_FILES = "gnustep-gui.pc"
include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/library.make

6
Source/gnustep-gui.pc.in Normal file
View file

@ -0,0 +1,6 @@
Name: gnustep-gui
Description: The GNUstep gui library is a library of graphical user interface classes written completely in the Objective-C language; the classes are based upon Apple's Cocoa framework (which came from the OpenStep specification).
Version: @GNUSTEP_GUI_VERSION@
URL: https://github.com/gnustep/libs-gui/
Libs: @GUILIBS@
Cflags: @GUIFLAGS@

13
configure vendored
View file

@ -628,6 +628,8 @@ GNUSTEP_GUI_SUBMINOR_VERSION
GNUSTEP_GUI_MINOR_VERSION
GNUSTEP_GUI_MAJOR_VERSION
GNUSTEP_GUI_VERSION
GUILIBS
GUIFLAGS
WARN_FLAGS
BUILD_GSCUPS
GSCUPS_DATADIR
@ -6024,6 +6026,14 @@ fi
#--------------------------------------------------------------------
# Get the Cflags and Libs values for gnustep-gui.pc
#--------------------------------------------------------------------
GUIFLAGS=`gnustep-config --objc-flags`
GUILIBS=`gnustep-config --gui-libs`
#--------------------------------------------------------------------
# Record the version
#--------------------------------------------------------------------
@ -6051,7 +6061,7 @@ CONFIG_SYSTEM_LIB_DIR="$CONFIG_SYSTEM_LIB_DIR $GRAPHIC_LFLAGS"
#--------------------------------------------------------------------
ac_config_files="$ac_config_files config.make gui.make Headers/Additions/GNUstepGUI/GSVersion.h"
ac_config_files="$ac_config_files config.make gui.make Source/gnustep-gui.pc Headers/Additions/GNUstepGUI/GSVersion.h"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -6745,6 +6755,7 @@ do
"Headers/Additions/GNUstepGUI/config.h") CONFIG_HEADERS="$CONFIG_HEADERS Headers/Additions/GNUstepGUI/config.h" ;;
"config.make") CONFIG_FILES="$CONFIG_FILES config.make" ;;
"gui.make") CONFIG_FILES="$CONFIG_FILES gui.make" ;;
"Source/gnustep-gui.pc") CONFIG_FILES="$CONFIG_FILES Source/gnustep-gui.pc" ;;
"Headers/Additions/GNUstepGUI/GSVersion.h") CONFIG_FILES="$CONFIG_FILES Headers/Additions/GNUstepGUI/GSVersion.h" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;

View file

@ -639,6 +639,12 @@ fi
AC_SUBST(WARN_FLAGS)
#--------------------------------------------------------------------
# Get the Cflags and Libs values for gnustep-gui.pc
#--------------------------------------------------------------------
AC_SUBST(GUIFLAGS, `gnustep-config --objc-flags`)
AC_SUBST(GUILIBS, `gnustep-config --gui-libs`)
#--------------------------------------------------------------------
# Record the version
#--------------------------------------------------------------------
@ -678,5 +684,5 @@ static double rint(double a) \
#endif
])
AC_CONFIG_FILES([config.make gui.make Headers/Additions/GNUstepGUI/GSVersion.h])
AC_CONFIG_FILES([config.make gui.make Source/gnustep-gui.pc Headers/Additions/GNUstepGUI/GSVersion.h])
AC_OUTPUT