Skip to contentSkip to conversation

Various autoconf fixups

PATCH In review Paul Kocialkowski 2 participants 5 messages Jul 19, 2017 Library code

lore
Share & tools
lore
#1 lore raw

PATCH 1/3 configure.ac: Enable back chamelium build by default

Introducing an option for chamelium build inadvertently disabled it by default, according to the definition of the AC_ARG_ENABLE macro.

This enables it back chamelium by default.

Fixes fd096fcc ("configure.ac: Make building chamelium an option")
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
index db0015e5..690f73ef 100644
@@ -183,7 +183,7 @@ PKG_CHECK_MODULES(GSL, gsl)
 # for chamelium
 AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--disable-chamelium],
 	      [Enable building of chamelium libraries and tests (default: yes)]),
-	      [enable_chamelium=yes], [enable_chamelium=no])
+	      [enable_chamelium=no], [enable_chamelium=yes])
 AM_CONDITIONAL(HAVE_CHAMELIUM, [test "x$enable_chamelium" = xyes])
 if test "x$enable_chamelium" = xyes; then
 	PKG_CHECK_MODULES(XMLRPC, xmlrpc xmlrpc_util xmlrpc_client, [],
Signature · 6 lines
2.13.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 2/3 configure.ac: Make glib dependency optional to preserve Android build

In reply to Paul Kocialkowski

This adds ifdef wrappers, with matching autoconf macros, to make the dependency on glib (used for parsing configuration) optional.

This allows preserving the ability to build IGT on Android, where glib support is lacking.

---
 configure.ac   | 8 +++++++-
 lib/igt_core.c | 9 +++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
configure.ac +7 -1
index 690f73ef..20e5cf96 100644
@@ -177,7 +177,10 @@ AM_CONDITIONAL(HAVE_UDEV, [test "x$udev" = xyes])
 if test x"$udev" = xyes; then
 	AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
 fi
-PKG_CHECK_MODULES(GLIB, glib-2.0)
+PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib=yes], [glib=no])
+if test x"$glib" = xyes; then
+	AC_DEFINE(HAVE_GLIB,1,[Enable glib support])
+fi
 PKG_CHECK_MODULES(GSL, gsl)
 
 # for chamelium
@@ -190,6 +193,9 @@ if test "x$enable_chamelium" = xyes; then
 			  [AC_MSG_ERROR([Failed to find xmlrpc, required by chamelium. Use --disable-chamelium to disable chamelium support.])])
 	PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
 			  [AC_MSG_ERROR([Failed to find pixman, required by chamelium. Use --disable-chamelium to disable chamelium support.])])
+	if test x"$glib" != xyes; then
+		AC_MSG_ERROR([Failed to find glib, required by chamelium. Use --disable-chamelium to disable chamelium support.])
+	fi
 	AC_DEFINE(HAVE_CHAMELIUM, 1, [Enable Chamelium support])
 fi
 
lib/igt_core.c +9 -0
index 5a3b00e8..028ef6bd 100644
@@ -293,7 +293,10 @@ static struct {
 } log_buffer;
 static pthread_mutex_t log_buffer_mutex = PTHREAD_MUTEX_INITIALIZER;
 
+#ifdef HAVE_GLIB
 GKeyFile *igt_key_file;
+#endif
+
 char *frame_dump_path;
 
 const char *igt_test_name(void)
@@ -618,6 +621,7 @@ static void oom_adjust_for_doom(void)
 
 }
 
+#ifdef HAVE_GLIB
 static int config_parse(void)
 {
 	GError *error = NULL;
@@ -643,6 +647,7 @@ static int config_parse(void)
 
 	return 0;
 }
+#endif
 
 static int common_init(int *argc, char **argv,
 		       const char *extra_short_opts,
@@ -799,6 +804,7 @@ static int common_init(int *argc, char **argv,
 		snprintf(key_file_loc, 100, "%s/.igtrc", g_get_home_dir());
 	}
 
+#ifdef HAVE_GLIB
 	igt_key_file = g_key_file_new();
 	ret = g_key_file_load_from_file(igt_key_file, key_file_loc,
 					G_KEY_FILE_NONE, &error);
@@ -811,6 +817,7 @@ static int common_init(int *argc, char **argv,
 	}
 
 	ret = config_parse();
+#endif
 
 out:
 	if (!key_file_env && key_file_loc)
@@ -1423,8 +1430,10 @@ void igt_exit(void)
 {
 	igt_exit_called = true;
 
+#ifdef HAVE_GLIB
 	if (igt_key_file)
 		g_key_file_free(igt_key_file);
+#endif
 
 	if (run_single_subtest && !run_single_subtest_found) {
 		igt_warn("Unknown subtest: %s\n", run_single_subtest);
Signature · 6 lines
2.13.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 3/3 configure.ac: Make gsl dependency and dependent code optional

In reply to Paul Kocialkowski

This adds automake instructions, with matching autoconf macros, to make the dependency on gsl and the code that depends on it optional.

This should allow preserving the ability to build IGT on Android, where gsl support may be lacking.

---
 configure.ac         | 6 +++++-
 lib/Makefile.am      | 7 +++++++
 lib/Makefile.sources | 2 --
 3 files changed, 12 insertions(+), 3 deletions(-)
configure.ac +5 -1
index 20e5cf96..de0e85dd 100644
@@ -181,7 +181,8 @@ PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib=yes], [glib=no])
 if test x"$glib" = xyes; then
 	AC_DEFINE(HAVE_GLIB,1,[Enable glib support])
 fi
-PKG_CHECK_MODULES(GSL, gsl)
+PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
+AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
 
 # for chamelium
 AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--disable-chamelium],
@@ -196,6 +197,9 @@ if test "x$enable_chamelium" = xyes; then
 	if test x"$glib" != xyes; then
 		AC_MSG_ERROR([Failed to find glib, required by chamelium. Use --disable-chamelium to disable chamelium support.])
 	fi
+	if test x"$gsl" != xyes; then
+		AC_MSG_ERROR([Failed to find gsl, required by chamelium. Use --disable-chamelium to disable chamelium support.])
+	fi
 	AC_DEFINE(HAVE_CHAMELIUM, 1, [Enable Chamelium support])
 fi
 
lib/Makefile.am +7 -0
index fb922ced..9b506f69 100644
@@ -29,6 +29,13 @@ lib_source_list +=	 	\
 	$(NULL)
 endif
 
+if HAVE_GSL
+lib_source_list +=	 	\
+	igt_frame.c		\
+	igt_frame.h		\
+	$(NULL)
+endif
+
 AM_CPPFLAGS = -I$(top_srcdir)
 AM_CFLAGS = \
 	    $(CWARNFLAGS) \
lib/Makefile.sources +0 -2
index c2e58809..53fdb54c 100644
@@ -83,8 +83,6 @@ lib_source_list =	 	\
 	uwildmat/uwildmat.c	\
 	igt_kmod.c		\
 	igt_kmod.h		\
-	igt_frame.c		\
-	igt_frame.h		\
 	$(NULL)
 
 .PHONY: version.h.tmp
Signature · 6 lines
2.13.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH i-g-t 3/3] configure.ac: Make gsl dependency and dependent code optional

R-B for the first two, I've already pushed them. For this one I'd prefer it if you just squashed it into the series where you add analog frame comparison support. Otherwise, looks good.

Quoted 65 lines · Paul Kocialkowski

This adds automake instructions, with matching autoconf macros, to make
the dependency on gsl and the code that depends on it optional.

This should allow preserving the ability to build IGT on Android, where
gsl support may be lacking.

---
 configure.ac         | 6 +++++-
 lib/Makefile.am      | 7 +++++++
 lib/Makefile.sources | 2 --
 3 files changed, 12 insertions(+), 3 deletions(-)
configure.ac +2 -1
index 20e5cf96..de0e85dd 100644
@@ -181,7 +181,8 @@ PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib=yes],
 [glib=no])
 if test x"$glib" = xyes; then
 	AC_DEFINE(HAVE_GLIB,1,[Enable glib support])
 fi
-PKG_CHECK_MODULES(GSL, gsl)
+PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
+AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
 
 # for chamelium

AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--disable-chamelium],

configure.ac +3 -0
@@ -196,6 +197,9 @@ if test "x$enable_chamelium" = xyes; then
 	if test x"$glib" != xyes; then
 		AC_MSG_ERROR([Failed to find glib, required by
 chamelium. Use --disable-chamelium to disable chamelium support.])
 	fi
+	if test x"$gsl" != xyes; then
+		AC_MSG_ERROR([Failed to find gsl, required by
 chamelium. Use --disable-chamelium to disable chamelium support.])
+	fi
 	AC_DEFINE(HAVE_CHAMELIUM, 1, [Enable Chamelium support])

fi

lib/Makefile.am +7 -0
index fb922ced..9b506f69 100644
@@ -29,6 +29,13 @@ lib_source_list +=	 	\
 	$(NULL)
 endif
 
+if HAVE_GSL
+lib_source_list +=	 	\
+	igt_frame.c		\
+	igt_frame.h		\
+	$(NULL)
+endif
+
 AM_CPPFLAGS = -I$(top_srcdir)
 AM_CFLAGS = \
 	    $(CWARNFLAGS) \
lib/Makefile.sources +0 -0
index c2e58809..53fdb54c 100644

lib/Makefile.sources lib_source_list = \ · line 88

Quoted 8 lines
lib/Makefile.sources +0 -2
@@ -83,8 +83,6 @@ lib_source_list =	 	\
 	uwildmat/uwildmat.c	\
 	igt_kmod.c		\
 	igt_kmod.h		\
-	igt_frame.c		\
-	igt_frame.h		\
 	$(NULL)
 
 .PHONY: version.h.tmp

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx