All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm 1/3] configure: request/set the compiler in C99 mode
@ 2015-04-08 16:52 Emil Velikov
  2015-04-08 16:52 ` [PATCH libdrm 2/3] drm: use c99 __func__ over __FUNCTION__ Emil Velikov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Emil Velikov @ 2015-04-08 16:52 UTC (permalink / raw)
  To: dri-devel; +Cc: emil.l.velikov

Required by intel and drmstat at least. Considering that every compiler
used to build libdrm is C99 compatible, just enable it for the whole
build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 configure.ac      | 5 +++++
 intel/Makefile.am | 2 --
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index e715262..320e482 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,11 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 # Check for programs
 AC_PROG_CC
+AC_PROG_CC_C99
+
+if test "x$ac_cv_prog_cc_c99" = xno; then
+	AC_MSG_ERROR([Building libdrm requires C99 enabled compiler])
+fi
 
 AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
diff --git a/intel/Makefile.am b/intel/Makefile.am
index de3baab..d004568 100644
--- a/intel/Makefile.am
+++ b/intel/Makefile.am
@@ -42,8 +42,6 @@ libdrm_intel_la_LIBADD = ../libdrm.la \
 
 libdrm_intel_la_SOURCES = $(LIBDRM_INTEL_FILES)
 
-intel_bufmgr_gem_o_CFLAGS = $(AM_CFLAGS) -c99
-
 libdrm_intelincludedir = ${includedir}/libdrm
 libdrm_intelinclude_HEADERS = $(LIBDRM_INTEL_H_FILES)
 
-- 
2.3.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH libdrm 2/3] drm: use c99 __func__ over __FUNCTION__
  2015-04-08 16:52 [PATCH libdrm 1/3] configure: request/set the compiler in C99 mode Emil Velikov
@ 2015-04-08 16:52 ` Emil Velikov
  2015-04-08 16:52 ` [PATCH libdrm 3/3] man: rework the Makefile.am Emil Velikov
  2015-04-21 15:44 ` [PATCH libdrm 1/3] configure: request/set the compiler in C99 mode Emil Velikov
  2 siblings, 0 replies; 4+ messages in thread
From: Emil Velikov @ 2015-04-08 16:52 UTC (permalink / raw)
  To: dri-devel; +Cc: emil.l.velikov

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 intel/intel_bufmgr_fake.c | 19 +++++++------------
 tests/drmstat.c           |  7 +------
 2 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/intel/intel_bufmgr_fake.c b/intel/intel_bufmgr_fake.c
index 54a3983..75387b7 100644
--- a/intel/intel_bufmgr_fake.c
+++ b/intel/intel_bufmgr_fake.c
@@ -52,11 +52,6 @@
 #include "libdrm_macros.h"
 #include "libdrm_lists.h"
 
-/* Support gcc's __FUNCTION__ for people using other compilers */
-#if !defined(__GNUC__) && !defined(__FUNCTION__)
-# define __FUNCTION__ __func__ /* C99 */
-#endif
-
 #define DBG(...) do {					\
 	if (bufmgr_fake->bufmgr.debug)			\
 		drmMsg(__VA_ARGS__);			\
@@ -278,7 +273,7 @@ _fence_emit_internal(drm_intel_bufmgr_fake *bufmgr_fake)
 	ret = drmCommandWriteRead(bufmgr_fake->fd, DRM_I915_IRQ_EMIT,
 				  &ie, sizeof(ie));
 	if (ret) {
-		drmMsg("%s: drm_i915_irq_emit: %d\n", __FUNCTION__, ret);
+		drmMsg("%s: drm_i915_irq_emit: %d\n", __func__, ret);
 		abort();
 	}
 
@@ -545,7 +540,7 @@ evict_lru(drm_intel_bufmgr_fake *bufmgr_fake, unsigned int max_fence)
 {
 	struct block *block, *tmp;
 
-	DBG("%s\n", __FUNCTION__);
+	DBG("%s\n", __func__);
 
 	DRMLISTFOREACHSAFE(block, tmp, &bufmgr_fake->lru) {
 		drm_intel_bo_fake *bo_fake = (drm_intel_bo_fake *) block->bo;
@@ -572,7 +567,7 @@ evict_mru(drm_intel_bufmgr_fake *bufmgr_fake)
 {
 	struct block *block, *tmp;
 
-	DBG("%s\n", __FUNCTION__);
+	DBG("%s\n", __func__);
 
 	DRMLISTFOREACHSAFEREVERSE(block, tmp, &bufmgr_fake->lru) {
 		drm_intel_bo_fake *bo_fake = (drm_intel_bo_fake *) block->bo;
@@ -632,7 +627,7 @@ clear_fenced(drm_intel_bufmgr_fake *bufmgr_fake, unsigned int fence_cookie)
 		}
 	}
 
-	DBG("%s: %d\n", __FUNCTION__, ret);
+	DBG("%s: %d\n", __func__, ret);
 	return ret;
 }
 
@@ -717,7 +712,7 @@ evict_and_alloc_block(drm_intel_bo *bo)
 		if (alloc_block(bo))
 			return 1;
 
-	DBG("%s 0x%lx bytes failed\n", __FUNCTION__, bo->size);
+	DBG("%s 0x%lx bytes failed\n", __func__, bo->size);
 
 	return 0;
 }
@@ -1027,12 +1022,12 @@ static int
 		    bo_fake->name, bo_fake->bo.size / 1024);
 
 		if (bo->virtual != NULL) {
-			drmMsg("%s: already mapped\n", __FUNCTION__);
+			drmMsg("%s: already mapped\n", __func__);
 			abort();
 		} else if (bo_fake->flags & (BM_NO_BACKING_STORE | BM_PINNED)) {
 
 			if (!bo_fake->block && !evict_and_alloc_block(bo)) {
-				DBG("%s: alloc failed\n", __FUNCTION__);
+				DBG("%s: alloc failed\n", __func__);
 				bufmgr_fake->fail = 1;
 				return 1;
 			} else {
diff --git a/tests/drmstat.c b/tests/drmstat.c
index c800ebb..023aa06 100644
--- a/tests/drmstat.c
+++ b/tests/drmstat.c
@@ -48,11 +48,6 @@
 #endif
 #include "xf86drm.h"
 
-/* Support gcc's __FUNCTION__ for people using other compilers */
-#if !defined(__GNUC__) && !defined(__FUNCTION__)
-# define __FUNCTION__ __func__ /* C99 */
-#endif
-
 int sigio_fd;
 
 static double usec(struct timeval *end, struct timeval *start)
@@ -87,7 +82,7 @@ static void process_sigio(char *device)
     int              fd;
 
     if ((fd = open(device, 0)) < 0) {
-	drmError(-errno, __FUNCTION__);
+	drmError(-errno, __func__);
 	exit(1);
     }
 
-- 
2.3.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH libdrm 3/3] man: rework the Makefile.am
  2015-04-08 16:52 [PATCH libdrm 1/3] configure: request/set the compiler in C99 mode Emil Velikov
  2015-04-08 16:52 ` [PATCH libdrm 2/3] drm: use c99 __func__ over __FUNCTION__ Emil Velikov
@ 2015-04-08 16:52 ` Emil Velikov
  2015-04-21 15:44 ` [PATCH libdrm 1/3] configure: request/set the compiler in C99 mode Emil Velikov
  2 siblings, 0 replies; 4+ messages in thread
From: Emil Velikov @ 2015-04-08 16:52 UTC (permalink / raw)
  To: dri-devel; +Cc: Niveditha Rau, emil.l.velikov

Remove GNU make specific constructs and take into consideration that
Solaris man 7 is not the same as Linux man 7.

This commit introduces a dependency of xorg-macros 1.12 (released 4+
years ago) which is used to handle the above man section discrepancies.

Cc: Niveditha Rau <niveditha.rau@oracle.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---

If people prefer I can split this patch into separate ones, but 
considering how much of a rework/rewrite of man/Makefile.am this 
turned up to be it might not be worth it.

Niveditha,

If you can grab the tarball [1] for your test it should handle most/all 
of the GNU make dependencies, as it's based on my for-solaris branch at
https://github.com/evelikov/libdrm

Thanks,
Emil

[1] http://people.freedesktop.org/~evelikov/for-solaris/libdrm-2.4.60.tar.gz

---
 Makefile.am     |  8 +++++-
 configure.ac    | 10 ++++++--
 man/Makefile.am | 80 ++++++++++++++++++++++++++++++---------------------------
 3 files changed, 57 insertions(+), 41 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 42d3d7f..13df80c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,6 +73,12 @@ if HAVE_TEGRA
 TEGRA_SUBDIR = tegra
 endif
 
+if BUILD_MANPAGES
+if HAVE_MANPAGES_STYLESHEET
+MAN_SUBDIR = man
+endif
+endif
+
 SUBDIRS = \
 	. \
 	$(LIBKMS_SUBDIR) \
@@ -84,7 +90,7 @@ SUBDIRS = \
 	$(FREEDRENO_SUBDIR) \
 	$(TEGRA_SUBDIR) \
 	tests \
-	man
+	$(MAN_SUBDIR)
 
 libdrm_la_LTLIBRARIES = libdrm.la
 libdrm_ladir = $(libdir)
diff --git a/configure.ac b/configure.ac
index 320e482..f8adf4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,13 @@ AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 
+# Require xorg-macros minimum of 1.12 for XORG_WITH_XSLTPROC
+m4_ifndef([XORG_MACROS_VERSION],
+          [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.12)
+XORG_WITH_XSLTPROC
+XORG_MANPAGE_SECTIONS
+
 AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2])
 
 # Enable quiet compiles on automake 1.11.
@@ -378,9 +385,8 @@ AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
 
 # xsltproc for docbook manpages
 AC_ARG_ENABLE([manpages],
-              AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
+              AS_HELP_STRING([--enable-manpages], [enable manpages @<:@default=auto@:>@]),
               [MANS=$enableval], [MANS=auto])
-AC_PATH_PROG(XSLTPROC, xsltproc)
 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$XSLTPROC" != "x" -a "x$MANS" != "xno"])
 
 # check for offline man-pages stylesheet
diff --git a/man/Makefile.am b/man/Makefile.am
index d25a293..44b63a5 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,63 +1,67 @@
 #
 # This generates man-pages out of the Docbook XML files. Simply add your files
-# to the $MANPAGES array. If aliases are created, please add them to the
-# MANPAGES_ALIASES array so they get installed correctly.
+# to the relevant *man_PRE array. If aliases are created, please add them to the
+# *man_aliases_PRE array so they get installed correctly.
 #
 
-MANPAGES = \
-	drm.7 \
-	drm-kms.7 \
-	drm-memory.7 \
-	drmAvailable.3 \
-	drmHandleEvent.3 \
-	drmModeGetResources.3
-MANPAGES_ALIASES = \
-	drm-mm.7 \
-	drm-gem.7 \
-	drm-ttm.7
+libman_PRE = \
+	drmAvailable.xml \
+	drmHandleEvent.xml \
+	drmModeGetResources.xml
 
-XML_FILES = \
-	$(patsubst %.1,%.xml,$(patsubst %.3,%.xml,$(patsubst %.5,%.xml,$(patsubst %.7,%.xml,$(MANPAGES)))))
+miscman_PRE = \
+	drm.xml \
+	drm-kms.xml \
+	drm-memory.xml
 
-EXTRA_DIST = $(XML_FILES)
-CLEANFILES = $(MANPAGES) $(MANPAGES_ALIASES) .man_fixup
-man_MANS =
+miscman_aliases_PRE = \
+	drm-mm.xml \
+	drm-gem.xml \
+	drm-ttm.xml
+
+libmandir = $(LIB_MAN_DIR)
+miscmandir = $(MISC_MAN_DIR)
+miscman_aliasesdir = $(MISC_MAN_DIR)
 
-if BUILD_MANPAGES
-if HAVE_MANPAGES_STYLESHEET
+libman_DATA = $(libman_PRE:.xml=.$(LIB_MAN_SUFFIX))
+miscman_DATA = $(miscman_PRE:.xml=.$(MISC_MAN_SUFFIX))
+miscman_aliases_DATA = $(miscman_aliases_PRE:.xml=.$(MISC_MAN_SUFFIX))
 
-man_MANS += $(MANPAGES) $(MANPAGES_ALIASES)
+XML_FILES = \
+	$(libman_PRE) \
+	$(miscman_PRE)
+
+MAN_FILES = \
+	$(libman_DATA) \
+	$(miscman_DATA) \
+	$(miscman_aliases_DATA)
+
+EXTRA_DIST = $(XML_FILES)
+CLEANFILES = $(MAN_FILES) .man_fixup
 
 XSLTPROC_FLAGS = \
 	--stringparam man.authors.section.enabled 0 \
 	--stringparam man.copyright.section.enabled 0 \
 	--stringparam funcsynopsis.style ansi \
 	--stringparam man.output.quietly 1 \
-	--nonet
+	--nonet \
+	$(MANPAGES_STYLESHEET)
 
 XSLTPROC_PROCESS_MAN = \
-	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
-	$(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) $(MANPAGES_STYLESHEET) "$<" && \
+	$(AM_V_GEN)$(XSLTPROC) -o "$@" $(XSLTPROC_FLAGS) "$<" && \
 	touch .man_fixup
 
-# Force .man_fixup if $(MANPAGES) are not built
-.man_fixup: | $(MANPAGES)
-	@touch .man_fixup
+# Force .man_fixup if $(miscman_DATA) are not built
+.man_fixup: | $(miscman_DATA)
+	$(AM_V_GEN)touch .man_fixup
 
-$(MANPAGES_ALIASES): $(MANPAGES) .man_fixup
+$(miscman_aliases_DATA): $(miscman_DATA) .man_fixup
 	$(AM_V_GEN)if test -n "$@" ; then $(SED) -i -e 's/^\.so \([a-z_]\+\)\.\([0-9]\)$$/\.so man\2\/\1\.\2/' "$@" ; fi
 
-%.1: $(top_srcdir)/man/%.xml
-	$(XSLTPROC_PROCESS_MAN)
+SUFFIXES = .$(LIB_MAN_SUFFIX) .$(MISC_MAN_SUFFIX) .xml
 
-%.3: $(top_srcdir)/man/%.xml
+.xml.$(LIB_MAN_SUFFIX):
 	$(XSLTPROC_PROCESS_MAN)
 
-%.5: $(top_srcdir)/man/%.xml
+.xml.$(MISC_MAN_SUFFIX):
 	$(XSLTPROC_PROCESS_MAN)
-
-%.7: $(top_srcdir)/man/%.xml
-	$(XSLTPROC_PROCESS_MAN)
-
-endif # HAVE_MANPAGES_STYLESHEET
-endif # BUILD_MANPAGES
-- 
2.3.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH libdrm 1/3] configure: request/set the compiler in C99 mode
  2015-04-08 16:52 [PATCH libdrm 1/3] configure: request/set the compiler in C99 mode Emil Velikov
  2015-04-08 16:52 ` [PATCH libdrm 2/3] drm: use c99 __func__ over __FUNCTION__ Emil Velikov
  2015-04-08 16:52 ` [PATCH libdrm 3/3] man: rework the Makefile.am Emil Velikov
@ 2015-04-21 15:44 ` Emil Velikov
  2 siblings, 0 replies; 4+ messages in thread
From: Emil Velikov @ 2015-04-21 15:44 UTC (permalink / raw)
  To: ML dri-devel; +Cc: Emil Velikov

Will anyone have any objections against the series. I am planning to
have this merged by the end of the week.

Thanks
Emil

On 8 April 2015 at 17:52, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> Required by intel and drmstat at least. Considering that every compiler
> used to build libdrm is C99 compatible, just enable it for the whole
> build.
>
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
> ---
>  configure.ac      | 5 +++++
>  intel/Makefile.am | 2 --
>  2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index e715262..320e482 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -36,6 +36,11 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
>
>  # Check for programs
>  AC_PROG_CC
> +AC_PROG_CC_C99
> +
> +if test "x$ac_cv_prog_cc_c99" = xno; then
> +       AC_MSG_ERROR([Building libdrm requires C99 enabled compiler])
> +fi
>
>  AC_USE_SYSTEM_EXTENSIONS
>  AC_SYS_LARGEFILE
> diff --git a/intel/Makefile.am b/intel/Makefile.am
> index de3baab..d004568 100644
> --- a/intel/Makefile.am
> +++ b/intel/Makefile.am
> @@ -42,8 +42,6 @@ libdrm_intel_la_LIBADD = ../libdrm.la \
>
>  libdrm_intel_la_SOURCES = $(LIBDRM_INTEL_FILES)
>
> -intel_bufmgr_gem_o_CFLAGS = $(AM_CFLAGS) -c99
> -
>  libdrm_intelincludedir = ${includedir}/libdrm
>  libdrm_intelinclude_HEADERS = $(LIBDRM_INTEL_H_FILES)
>
> --
> 2.3.1
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-21 15:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-08 16:52 [PATCH libdrm 1/3] configure: request/set the compiler in C99 mode Emil Velikov
2015-04-08 16:52 ` [PATCH libdrm 2/3] drm: use c99 __func__ over __FUNCTION__ Emil Velikov
2015-04-08 16:52 ` [PATCH libdrm 3/3] man: rework the Makefile.am Emil Velikov
2015-04-21 15:44 ` [PATCH libdrm 1/3] configure: request/set the compiler in C99 mode Emil Velikov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.