[mutter] Always generate meta-default-modes.h
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Always generate meta-default-modes.h
- Date: Tue, 6 Nov 2018 18:06:44 +0000 (UTC)
commit 8a03f1ad0210ac9461d1723831e41eb656c06000
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Sat Jul 7 15:28:41 2018 +0200
Always generate meta-default-modes.h
This adds a hard requirement on having cvt installed, which in the past
was soft, where the generated file was added to the repository.
configure.ac | 3 ++
src/Makefile.am | 6 ++--
src/backends/native/gen-default-modes.py | 19 +++++++++--
src/backends/native/meta-default-modes.h | 57 --------------------------------
src/backends/native/meta-gpu-kms.c | 3 +-
src/backends/native/meta-output-kms.c | 3 +-
6 files changed, 26 insertions(+), 65 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ef92f5ecb..97cdac859 100644
--- a/configure.ac
+++ b/configure.ac
@@ -445,6 +445,9 @@ AC_CHECK_DECL([GL_EXT_x11_sync_object],
[#include <GL/glx.h>])
AC_PATH_PROG([CVT],[cvt],[])
+if test x"$CVT" = xno; then
+ AC_MSG_ERROR([cvt not found in your path])
+fi
#### Warnings (last since -Werror can disturb other tests)
diff --git a/src/Makefile.am b/src/Makefile.am
index 811e2b86b..5e7543711 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -51,6 +51,7 @@ mutter_built_sources = \
$(dbus_login1_built_sources) \
meta/meta-enum-types.h \
meta-enum-types.c \
+ meta-default-modes.h \
$(NULL)
if HAVE_REMOTE_DESKTOP
@@ -505,7 +506,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
backends/native/meta-clutter-backend-native.h \
backends/native/meta-cursor-renderer-native.c \
backends/native/meta-cursor-renderer-native.h \
- backends/native/meta-default-modes.h \
backends/native/meta-gpu-kms.c \
backends/native/meta-gpu-kms.h \
backends/native/meta-input-settings-native.c \
@@ -760,10 +760,10 @@ $(dbus_login1_built_sources) : Makefile.am org.freedesktop.login1.xml
--c-generate-autocleanup all \
$(srcdir)/org.freedesktop.login1.xml
-backends/native/meta-default-modes.h: backends/native/gen-default-modes.py Makefile.am
+meta-default-modes.h: backends/native/gen-default-modes.py Makefile.am
@if test -n "$(CVT)"; then \
if $(AM_V_P); then PS4= set -x; else echo " GEN $@"; fi; \
- python $< > $@; \
+ $(top_srcdir)/src/backends/native/gen-default-modes.py $@; \
fi
.SECONDEXPANSION:
diff --git a/src/backends/native/gen-default-modes.py b/src/backends/native/gen-default-modes.py
old mode 100644
new mode 100755
index a94f44b50..304cd0303
--- a/src/backends/native/gen-default-modes.py
+++ b/src/backends/native/gen-default-modes.py
@@ -1,3 +1,5 @@
+#!/usr/bin/python3
+
# Copyright (C) 2016 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or
@@ -18,6 +20,10 @@
import os
import sys
+if len(sys.argv) != 2:
+ print("Usage: %s [output file]"%sys.argv[0])
+ exit(1)
+
common_resolutions = [
# 4:3
(800, 600),
@@ -109,6 +115,13 @@ for resolution in common_resolutions:
cvt.close()
output_lines.append("};")
-for line in output_lines:
- sys.stdout.write(line + "\n")
-sys.stdout.flush()
+try:
+ output_file = open(sys.argv[1], 'w')
+
+ for line in output_lines:
+ output_file.write(line + "\n")
+ output_file.flush()
+ output_file.close()
+except:
+ print("Failed to generate modelines:", sys.exc_info()[0])
+ exit(1)
diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
index 53a540b84..57582f699 100644
--- a/src/backends/native/meta-gpu-kms.c
+++ b/src/backends/native/meta-gpu-kms.c
@@ -38,7 +38,8 @@
#include "backends/native/meta-crtc-kms.h"
#include "backends/native/meta-launcher.h"
#include "backends/native/meta-output-kms.h"
-#include "backends/native/meta-default-modes.h"
+
+#include "meta-default-modes.h"
typedef struct _MetaKmsSource
{
diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c
index f33f65dc7..2e870658c 100644
--- a/src/backends/native/meta-output-kms.c
+++ b/src/backends/native/meta-output-kms.c
@@ -29,7 +29,8 @@
#include "backends/meta-crtc.h"
#include "backends/native/meta-crtc-kms.h"
-#include "backends/native/meta-default-modes.h"
+
+#include "meta-default-modes.h"
#define SYNC_TOLERANCE 0.01 /* 1 percent */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]