[gtk/gtk-3-24-meson: 84/95] meson: Various config.h related fixes



commit 28833783cc6794d101a7f13abb063f8e0254dc34
Author: Christoph Reiter <creiter src gnome org>
Date:   Mon Apr 1 20:57:45 2019 +0200

    meson: Various config.h related fixes
    
    Various adjustments to make the config.h output between autotools
    and meson more similar by testing on Linux and Windows/MSYS2.
    
    Setting things to 1 instead of true and shifting things around is motivated
    by reducing the diff between the generated files.

 config.h.meson                    | 119 ++++++++++++++------------------------
 gtk/meson.build                   |  12 ++--
 meson.build                       |  61 ++++++++++++++-----
 modules/printbackends/meson.build |   2 +-
 4 files changed, 97 insertions(+), 97 deletions(-)
---
diff --git a/config.h.meson b/config.h.meson
index fe5f861927..f90c96b7e6 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -1,6 +1,8 @@
+/* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
-/* always defined to indicate that i18n is enabled */
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
 #mesondefine ENABLE_NLS
 
 /* The prefix for our gettext translation domains. */
@@ -9,12 +11,12 @@
 /* Disable deprecation warnings from glib */
 #mesondefine GLIB_DISABLE_DEPRECATION_WARNINGS
 
-/* Define the location where the catalogs will be installed */
-#mesondefine GTK_LOCALEDIR
-
 /* Define to 1 if you have the `bind_textdomain_codeset' function. */
 #mesondefine HAVE_BIND_TEXTDOMAIN_CODESET
 
+/* Define if libcloudproviders is available */
+#mesondefine HAVE_CLOUDPROVIDERS
+
 /* define if we have colord */
 #mesondefine HAVE_COLORD
 
@@ -24,7 +26,8 @@
 /* Define to 1 if CUPS 1.6 API is available */
 #mesondefine HAVE_CUPS_API_1_6
 
-/* Define to 1 if you have the `dcgettext' function. */
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+   */
 #mesondefine HAVE_DCGETTEXT
 
 /* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
@@ -35,9 +38,18 @@
    */
 #mesondefine HAVE_DECL_ISNAN
 
+/* Define to 1 if you have the <dev/evdev/input.h> header file. */
+#mesondefine HAVE_DEV_EVDEV_INPUT_H
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #mesondefine HAVE_DLFCN_H
 
+/* Define to 1 if you have the `exp2' function. */
+#mesondefine HAVE_EXP2
+
+/* Define to 1 if you have the `flockfile' function. */
+#mesondefine HAVE_FLOCKFILE
+
 /* Define to 1 if you have the <ftw.h> header file. */
 #mesondefine HAVE_FTW_H
 
@@ -47,14 +59,11 @@
 /* Define to 1 if you have the `getresuid' function. */
 #mesondefine HAVE_GETRESUID
 
-/* Define if the GNU gettext() function is already present or preinstalled. */
-#mesondefine HAVE_GETTEXT
-
 /* Define if gio-unix is available */
 #mesondefine HAVE_GIO_UNIX
 
-/* Have GNU ftw */
-#mesondefine HAVE_GNU_FTW
+/* defines whether we have HarfBuzz */
+#mesondefine HAVE_HARFBUZZ
 
 /* Define to 1 if you have the `httpGetAuthString' function. */
 #mesondefine HAVE_HTTPGETAUTHSTRING
@@ -68,18 +77,18 @@
 /* Define to 1 if the system has the type `IPrintDialogCallback'. */
 #mesondefine HAVE_IPRINTDIALOGCALLBACK
 
-/* Define if your <locale.h> file defines LC_MESSAGES. */
-#mesondefine HAVE_LC_MESSAGES
-
-/* Define to 1 if you have the `m' library (-lm). */
-#mesondefine HAVE_LIBM
+/* Define to 1 if you have the <linux/input.h> header file. */
+#mesondefine HAVE_LINUX_INPUT_H
 
-/* Define to 1 if you have the <locale.h> header file. */
-#mesondefine HAVE_LOCALE_H
+/* Define to 1 if you have the <linux/memfd.h> header file. */
+#mesondefine HAVE_LINUX_MEMFD_H
 
 /* Define to 1 if you have the `localtime_r' function. */
 #mesondefine HAVE_LOCALTIME_R
 
+/* Define to 1 if you have the `log2' function. */
+#mesondefine HAVE_LOG2
+
 /* Define to 1 if you have the `lstat' function. */
 #mesondefine HAVE_LSTAT
 
@@ -98,6 +107,9 @@
 /* Define to 1 if you have the `nearbyint' function. */
 #mesondefine HAVE_NEARBYINT
 
+/* defines whether we have pangoft2 */
+#mesondefine HAVE_PANGOFT
+
 /* Define to 1 if libpapi available */
 #mesondefine HAVE_PAPI
 
@@ -116,18 +128,12 @@
 /* Define to 1 if you have the `round' function. */
 #mesondefine HAVE_ROUND
 
+/* Define to 1 if SetupDiGetDevicePropertyW() is available */
+#mesondefine HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W
+
 /* Define to 1 if you have the `sincos' function. */
 #mesondefine HAVE_SINCOS
 
-/* Define to 1 if you have the `log2` function */
-#mesondefine HAVE_LOG2
-
-/* Define to 1 if you ahve the `exp2` function */
-#mesondefine HAVE_EXP2
-
-/* Have the sockaddr_un.sun_len member */
-#mesondefine HAVE_SOCKADDR_UN_SUN_LEN
-
 /* Define to 1 if solaris xinerama is available */
 #mesondefine HAVE_SOLARIS_XINERAMA
 
@@ -164,6 +170,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #mesondefine HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the `trunc' function. */
+#mesondefine HAVE_TRUNC
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #mesondefine HAVE_UNISTD_H
 
@@ -194,12 +203,9 @@
 /* Have the SYNC extension library */
 #mesondefine HAVE_XSYNC
 
-/* Define to 1 if you have the `_lock_file' function */
+/* Define to 1 if you have the `_lock_file' function. */
 #mesondefine HAVE__LOCK_FILE
 
-/* Define to 1 if you have the `flockfile' function */
-#mesondefine HAVE_FLOCKFILE
-
 /* Define if _NL_MEASUREMENT_MEASUREMENT is available */
 #mesondefine HAVE__NL_MEASUREMENT_MEASUREMENT
 
@@ -215,15 +221,9 @@
 /* Define to 1 if you have the `_NSGetEnviron' function. */
 #mesondefine HAVE__NSGETENVIRON
 
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
-#mesondefine LT_OBJDIR
-
 /* Define if <X11/extensions/XIproto.h> needed for xReply */
 #mesondefine NEED_XIPROTO_H_FOR_XREPLY
 
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#mesondefine NO_MINUS_C_MINUS_O
-
 /* Define to the address where bug reports for this package should be sent. */
 #mesondefine PACKAGE_BUGREPORT
 
@@ -246,33 +246,9 @@
    etc. */
 #mesondefine QUARTZ_RELOCATION
 
-/* Define to 1 if you have the ANSI C header files. */
-#mesondefine STDC_HEADERS
-
-/* Define to 1 if gmodule works and should be used */
-#mesondefine USE_GMODULE
-
-/* Enable extensions on AIX 3, Interix.  */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them.  */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris.  */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop.  */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
+/* The size of `DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', as computed by sizeof.
+   */
+#mesondefine SIZEOF_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY
 
 /* Define to 1 if XInput 2.0 is available */
 #mesondefine XINPUT_2
@@ -280,9 +256,6 @@
 /* Define to 1 if XInput 2.2 is available */
 #mesondefine XINPUT_2_2
 
-/* Define to 1 if the X Window System is missing or not being used. */
-#mesondefine X_DISPLAY_MISSING
-
 /* Enable large inode numbers on Mac OS X 10.5.  */
 #ifndef _DARWIN_USE_64_BIT_INODE
 # define _DARWIN_USE_64_BIT_INODE 1
@@ -313,19 +286,13 @@
 /* Define to `int' if <sys/types.h> doesn't define. */
 #mesondefine uid_t
 
-/* Define to 1 if linux/memfd.h exists */
-#mesondefine HAVE_LINUX_MEMFD_H
-
-#mesondefine GTK_LOCALEDIR
-
 #mesondefine GTK_DATADIR
 
 #mesondefine GTK_LIBDIR
 
-#mesondefine HAVE_LINUX_INPUT_H
-
-#mesondefine HAVE_DEV_EVDEV_INPUT_H
+#mesondefine GTK_PRINT_BACKENDS
 
-#mesondefine HAVE_TRUNC
+/* Define the location where the catalogs will be installed */
+#mesondefine GTK_LOCALEDIR
 
-#mesondefine GTK_PRINT_BACKENDS
+#mesondefine ISO_CODES_PREFIX
diff --git a/gtk/meson.build b/gtk/meson.build
index 9dcf309e9d..06f3c943bc 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -9,10 +9,10 @@ gtk_cargs = [
   '-DGTK_BINARY_VERSION="@0@"'.format(gtk_binary_version),
   '-DGTK_HOST="@0@"'.format(host_machine.system()),
   '-DGTK_DATA_PREFIX="@0@"'.format(gtk_prefix),
-       '-DGTK_LIBDIR="@0@"'.format(gtk_libdir),
-       '-DGTK_LOCALEDIR="@0@"'.format(gtk_localedir),
-       '-DGTK_DATADIR="@0@"'.format(gtk_datadir),
-       '-DGTK_SYSCONFDIR="@0@"'.format(gtk_sysconfdir),
+  '-DGTK_LIBDIR="@0@"'.format(gtk_libdir),
+  '-DGTK_LOCALEDIR="@0@"'.format(gtk_localedir),
+  '-DGTK_DATADIR="@0@"'.format(gtk_datadir),
+  '-DGTK_SYSCONFDIR="@0@"'.format(gtk_sysconfdir),
 ]
 
 # List of sources to build the library from
@@ -830,6 +830,8 @@ gtk_deps = [
   platform_gio_dep,
   pangocairo_dep,
   pango_dep,
+  pangoft_dep,
+  harfbuzz_dep,
   fribidi_dep,
   cairogobj_dep,
   cairo_dep,
@@ -935,7 +937,7 @@ if cc.has_header('langinfo.h')
                      '_NL_PAPER_HEIGHT',
                      '_NL_PAPER_WIDTH',
                      '_NL_TIME_FIRST_WEEKDAY', ]
-    cdata.set('HAVE_' + nl_enum, cc.has_header_symbol('langinfo.h', nl_enum))
+    cdata.set('HAVE_' + nl_enum, cc.has_header_symbol('langinfo.h', nl_enum) ? 1 : false)
   endforeach
 endif
 
diff --git a/meson.build b/meson.build
index 2359bb4124..5e83ecb5d8 100644
--- a/meson.build
+++ b/meson.build
@@ -149,6 +149,14 @@ cdata.set('GTK_MICRO_VERSION', gtk_micro_version)
 cdata.set('GTK_BINARY_AGE', gtk_binary_age)
 cdata.set('GTK_INTERFACE_AGE', gtk_interface_age)
 
+cdata.set_quoted('PACKAGE_URL', '')
+cdata.set_quoted('PACKAGE_NAME', 'gtk+')
+cdata.set_quoted('PACKAGE_TARNAME', 'gtk+')
+cdata.set_quoted('PACKAGE_STRING', 'gtk+ @0@'.format(meson.project_version()))
+cdata.set_quoted('PACKAGE_BUGREPORT', 'http://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B')
+
+cdata.set('ENABLE_NLS', 1)
+
 check_headers = [
   'crt/externs.h',
   'dlfcn.h',
@@ -200,6 +208,7 @@ check_functions = [
   'exp2',
   'sincos',
   'trunc',
+  'localtime_r',
 ]
 
 foreach func : check_functions
@@ -208,8 +217,8 @@ foreach func : check_functions
   endif
 endforeach
 
-cdata.set('HAVE_DECL_ISINF', cc.has_header_symbol('math.h', 'isinf'))
-cdata.set('HAVE_DECL_ISNAN', cc.has_header_symbol('math.h', 'isnan'))
+cdata.set('HAVE_DECL_ISINF', cc.has_header_symbol('math.h', 'isinf') ? 1 : false)
+cdata.set('HAVE_DECL_ISNAN', cc.has_header_symbol('math.h', 'isnan') ? 1 : false)
 
 # Disable deprecation checks for all libraries we depend on on stable branches.
 # This is so newer versions of those libraries don't cause more warnings with
@@ -271,8 +280,10 @@ common_cflags = cc.get_supported_arguments(test_cflags)
 if get_option('default_library') != 'static'
   if os_win32
     cdata.set('DLL_EXPORT', true)
-    cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern')
-    if cc.get_id() != 'msvc'
+    if cc.get_id() == 'msvc'
+      cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern')
+    else
+      cdata.set('_GDK_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern')
       common_cflags += ['-fvisibility=hidden']
     endif
   else
@@ -411,7 +422,7 @@ endif
 if iso_codes_dep.found()
   cdata.set_quoted('ISO_CODES_PREFIX', iso_codes_dep.get_pkgconfig_variable('prefix'))
 else
-  cdata.set_quoted('ISO_CODES_PREFIX', '/usr')
+  cdata.set_quoted('ISO_CODES_PREFIX', get_option('prefix'))
 endif
 
 backend_immodules = []
@@ -462,8 +473,8 @@ endif
 
 cairo_libs = []
 
-cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found())
-cdata.set('HAVE_PANGOFT', pangoft_dep.found())
+cdata.set('HAVE_HARFBUZZ', harfbuzz_dep.found() ? 1 : false)
+cdata.set('HAVE_PANGOFT', pangoft_dep.found() ? 1 : false)
 
 atk_pkgs = ['atk']
 
@@ -518,10 +529,10 @@ if x11_enabled
 
   atk_pkgs += ['atk-bridge-2.0']
 
-  cdata.set('HAVE_XDAMAGE', xdamage_dep.found())
-  cdata.set('HAVE_XCURSOR', xcursor_dep.found())
-  cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found())
-  cdata.set('HAVE_XFIXES', xfixes_dep.found())
+  cdata.set('HAVE_XDAMAGE', xdamage_dep.found() ? 1 : false)
+  cdata.set('HAVE_XCURSOR', xcursor_dep.found() ? 1 : false)
+  cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found() ? 1 : false)
+  cdata.set('HAVE_XFIXES', xfixes_dep.found() ? 1 : false)
 
   if cc.has_function('XkbQueryExtension', dependencies: x11_dep,
                      prefix : '#include <X11/XKBlib.h>')
@@ -558,14 +569,15 @@ if x11_enabled
     xinerama_dep = dependency('xinerama', required: want_xinerama)
     if xinerama_dep.found() and cc.has_header_symbol('X11/extensions/Xinerama.h', 'XineramaQueryExtension', 
dependencies: xinerama_dep)
       cdata.set('HAVE_XFREE_XINERAMA', 1)
+      cdata.set('HAVE_XINERAMA', 1)
       x11_pkgs += ['xinerama']
     endif
   else
     xinerama_dep = []
   endif
 
-  cdata.set('HAVE_RANDR', xrandr_dep.found())
-  cdata.set('HAVE_RANDR15', xrandr15_dep.found())
+  cdata.set('HAVE_RANDR', xrandr_dep.found() ? 1 : false)
+  cdata.set('HAVE_RANDR15', xrandr15_dep.found() ? 1 : false)
 endif
 
 if broadway_enabled
@@ -724,12 +736,31 @@ if os_win32
   if cc.has_header_symbol('windows.h', 'IPrintDialogCallback')
     cdata.set('HAVE_IPRINTDIALOGCALLBACK', 1)
   endif
+
+  dvot_size = cc.sizeof('DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', prefix : '''
+    #define _WIN32_WINNT 0x601
+    #include <windows.h>
+  ''')
+  cdata.set('SIZEOF_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY', dvot_size)
+
+  getdevprop_code = '''
+    #define _WIN32_WINNT 0x0600
+    #include <windows.h>
+    #include <devpropdef.h>
+    #include <setupapi.h>
+
+    int main(int argc, char *argv[]) {
+      return SetupDiGetDevicePropertyW(NULL, NULL, NULL, NULL, NULL, 0, NULL, 0);
+    }
+  '''
+  result = cc.links(getdevprop_code, args: ['-lsetupapi'], name: 'has SetupDiGetDevicePropertyW')
+  cdata.set('HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W', result ? 1 : false)
 endif
 
 have_gio_unix = false
 if os_unix
   have_gio_unix = giounix_dep.found()
-  cdata.set('HAVE_GIO_UNIX', have_gio_unix)
+  cdata.set('HAVE_GIO_UNIX', have_gio_unix ? 1 : false)
 endif
 
 cloudproviders_enabled = get_option('cloudproviders')
@@ -738,7 +769,7 @@ if cloudproviders_enabled
   cloudproviders_dep = dependency('cloudproviders', version: cloudproviders_req, required: true)
   if cloudproviders_dep.found()
     cloudproviders_packages += ['cloudproviders', cloudproviders_req]
-    cdata.set('HAVE_CLOUDPROVIDERS', cloudproviders_dep.found())
+    cdata.set('HAVE_CLOUDPROVIDERS', cloudproviders_dep.found() ? 1 : false)
   else
     error('Cloudproviders support not found, but was explicitly requested.')
   endif
diff --git a/modules/printbackends/meson.build b/modules/printbackends/meson.build
index 894572be0c..36f322b487 100644
--- a/modules/printbackends/meson.build
+++ b/modules/printbackends/meson.build
@@ -98,7 +98,7 @@ if enabled_print_backends.contains('cups')
   if enable_colord != 'no'
     want_colord = enable_colord == 'yes'
     colord_dep = dependency('colord', version: '>= 0.1.9', required: want_colord)
-    cdata.set('HAVE_COLORD', colord_dep.found())
+    cdata.set('HAVE_COLORD', colord_dep.found() ? 1 : false)
   else
     cups_colord_dep = []
   endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]