[Mesa-dev] [PATCH] r300g: Use automake to generate Makefile v2
Matt Turner
mattst88 at gmail.com
Wed Feb 22 20:39:14 PST 2012
First off, it doesn't build for me --
mklib: Making Linux shared library: r300_dri.so.tmp
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../x86_64-pc-linux-gnu/bin/ld:
../../../../src/gallium/drivers/r300/libr300.a(r300_screen.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
../../../../src/gallium/drivers/r300/libr300.a: could not read
symbols: Bad value
collect2: ld returned 1 exit status
I think we'll have to hack it and add -fPIC to the local CFLAGS until
the rest is converted.
On Wed, Feb 22, 2012 at 8:14 PM, Tom Stellard <tstellar at gmail.com> wrote:
> v2:
> - s/$(top_builddir)/$(top_srcdir)/
> - Always generate Makefile.in
> ---
> configure.ac | 1 +
> src/gallium/drivers/r300/.gitignore | 5 ++
> src/gallium/drivers/r300/Makefile | 25 ---------
> src/gallium/drivers/r300/Makefile.am | 38 ++++++++++++++
> src/gallium/drivers/r300/compiler/tests/.gitignore | 1 -
> src/gallium/drivers/r300/compiler/tests/Makefile | 53 --------------------
> 6 files changed, 44 insertions(+), 79 deletions(-)
> create mode 100644 src/gallium/drivers/r300/.gitignore
> delete mode 100644 src/gallium/drivers/r300/Makefile
> create mode 100644 src/gallium/drivers/r300/Makefile.am
> delete mode 100644 src/gallium/drivers/r300/compiler/tests/.gitignore
> delete mode 100644 src/gallium/drivers/r300/compiler/tests/Makefile
>
> diff --git a/configure.ac b/configure.ac
> index 846b623..c8850cf 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1932,6 +1932,7 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
>
> dnl Substitute the config
> AC_CONFIG_FILES([configs/autoconf
> + src/gallium/drivers/r300/Makefile
> src/gbm/Makefile
> src/gbm/main/gbm.pc
> src/egl/wayland/Makefile
> diff --git a/src/gallium/drivers/r300/.gitignore b/src/gallium/drivers/r300/.gitignore
> new file mode 100644
> index 0000000..5e510eb
> --- /dev/null
> +++ b/src/gallium/drivers/r300/.gitignore
> @@ -0,0 +1,5 @@
> +Makefile
> +Makefile.in
> +radeon_compiler_util_tests
> +.libs/
> +.deps/
> diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile
> deleted file mode 100644
> index 2af1913..0000000
> --- a/src/gallium/drivers/r300/Makefile
> +++ /dev/null
> @@ -1,25 +0,0 @@
> -TOP = ../../../..
> -include $(TOP)/configs/current
> -
> -LIBNAME = r300
> -
> -# get C_SOURCES
> -include Makefile.sources
> -
> -# needed to build non-libmesagallium.a targets
> -C_SOURCES += \
> - $(TOP)/src/glsl/ralloc.c \
> - $(TOP)/src/mesa/program/register_allocate.c
> -
> -#This is for libdrm inlude path
> -CFLAGS+=$(RADEON_CFLAGS)
> -
> -LIBRARY_INCLUDES = \
> - -I$(TOP)/include \
> - -I$(TOP)/src/mesa \
> - -I$(TOP)/src/glsl
> -
> -include ../../Makefile.template
> -
> -test: default
> - @$(MAKE) -s -C compiler/tests/
> diff --git a/src/gallium/drivers/r300/Makefile.am b/src/gallium/drivers/r300/Makefile.am
> new file mode 100644
> index 0000000..298aa40
> --- /dev/null
> +++ b/src/gallium/drivers/r300/Makefile.am
> @@ -0,0 +1,38 @@
> +include Makefile.sources
> +
> +noinst_LIBRARIES = libr300.a
> +noinst_PROGRAMS = radeon_compiler_util_tests
This should be check_PROGRAMS = radeon_compiler_util_tests unless we
actually want to build this during `make` and not specifically `make
check`
> +testdir=compiler/tests
> +
> +AM_CFLAGS = \
> + -I$(top_srcdir)/src/gallium/include \
> + -I$(top_srcdir)/src/gallium/auxiliary \
> + -I$(top_srcdir)/src/gallium/drivers \
> + -I$(top_srcdir)/include \
> + -I$(top_srcdir)/src/mesa \
> + -I$(top_srcdir)/src/glsl \
> + -I$(top_srcdir)/src/mapi \
> + $(LLVM_CFLAGS) \
> + $(RADEON_CFLAGS)
> +
> +libr300_a_SOURCES = \
> + $(C_SOURCES) \
> + $(top_srcdir)/src/glsl/ralloc.c \
> + $(top_srcdir)/src/mesa/program/register_allocate.c
> +
> +test_LDADD = libr300.a
> +test_SOURCES = \
> + $(testdir)/rc_test_helpers.c \
> + $(testdir)/unit_test.c
> +test_CFLAGS = -I$(top_srcdir)/src/gallium/drivers/r300/compiler
> +
> +radeon_compiler_util_tests_LDADD = $(test_LDADD)
> +radeon_compiler_util_tests_CFLAGS = $(test_CFLAGS)
> +radeon_compiler_util_tests_SOURCES = \
> + $(test_SOURCES) \
> + $(testdir)/radeon_compiler_util_tests.c
>
I don't understand the indirection with the test_* variables. I think
we should just remove it.
> +default: libr300.a
> +
I see that the rest of the build system wants to `make default` in
r300/. Let's add a note to remove this when the rest of the system is
converted.
> +test: $(noinst_PROGRAMS)
> + $(foreach test, $^, @./$(test))
We can just use automake's TESTS variable to do this. If `make test`
is called by some other makefile, then just add 'test: check'.
With the attached patch squashed in, I think it's good to go.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.patch
Type: text/x-patch
Size: 1525 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20120222/979d341a/attachment.bin>
More information about the mesa-dev
mailing list