Us poor souls who cross compile mesa want to be able to specify which pkg-config to pick, or at least just change one place.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
MAKE = make
FLEX = flex
BISON = bison
+PKG_CONFIG = pkg-config
# Use MINSTALL for installing libraries, INSTALL for everything else
MINSTALL = $(SHELL) $(TOP)/bin/minstall
# Library/program dependencies
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
-LIBDRM_CFLAGS = `pkg-config --cflags libdrm`
-LIBDRM_LIB = `pkg-config --libs libdrm`
+LIBDRM_CFLAGS = `$(PKG_CONFIG) --cflags libdrm`
+LIBDRM_LIB = `$(PKG_CONFIG) --libs libdrm`
DRI_LIB_DEPS = $(MESA_MODULES) -L/usr/local/lib -lm -pthread -lexpat $(LIBDRM_LIB)
GL_LIB_DEPS = -L/usr/local/lib -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -pthread $(LIBDRM_LIB)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
-LIBDRM_LIB = $(shell pkg-config --libs libdrm)
+LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
+LIBDRM_LIB = $(shell $(PKG_CONFIG) --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl $(LIBDRM_LIB)
DRI_DIRS = i915 i965 nouveau r200 r300 r600 radeon swrast
-INTEL_LIBS = $(shell pkg-config --libs libdrm_intel)
-INTEL_CFLAGS = $(shell pkg-config --cflags libdrm_intel)
+INTEL_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_intel)
+INTEL_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_intel)
-NOUVEAU_LIBS = $(shell pkg-config --libs libdrm_nouveau)
-NOUVEAU_CFLAGS = $(shell pkg-config --cflags libdrm_nouveau)
+NOUVEAU_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_nouveau)
+NOUVEAU_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_nouveau)
-LIBDRM_RADEON_LIBS = $(shell pkg-config --libs libdrm_radeon)
-LIBDRM_RADEON_CFLAGS = $(shell pkg-config --cflags libdrm_radeon)
+LIBDRM_RADEON_LIBS = $(shell $(PKG_CONFIG) --libs libdrm_radeon)
+LIBDRM_RADEON_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm_radeon)
RADEON_CFLAGS = "-DHAVE_LIBDRM_RADEON=1 $(LIBDRM_RADEON_CFLAGS)"
RADEON_LDFLAGS = $(LIBDRM_RADEON_LIBS)
-DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING \
-DHAVE_ALIAS -DUSE_XCB -DHAVE_POSIX_MEMALIGN
-X11_INCLUDES = $(shell pkg-config --cflags-only-I x11) $(shell pkg-config --cflags-only-I xcb) $(shell pkg-config --cflags-only-I x11-xcb) $(shell pkg-config --cflags-only-I xcb-glx)
+X11_INCLUDES = $(shell $(PKG_CONFIG) --cflags-only-I x11) $(shell $(PKG_CONFIG) --cflags-only-I xcb) $(shell $(PKG_CONFIG) --cflags-only-I x11-xcb) $(shell $(PKG_CONFIG) --cflags-only-I xcb-glx)
CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) -std=c99 -ffast-math
MESA_ASM_SOURCES =
# Library/program dependencies
-EXTRA_LIB_PATH=$(shell pkg-config --libs-only-L x11)
+EXTRA_LIB_PATH=$(shell $(PKG_CONFIG) --libs-only-L x11)
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
-LIBDRM_LIB = $(shell pkg-config --libs libdrm)
+LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
+LIBDRM_LIB = $(shell $(PKG_CONFIG) --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lm -lpthread -ldl \
- $(LIBDRM_LIB) $(shell pkg-config --libs xcb) $(shell pkg-config --libs x11-xcb) $(shell pkg-config --libs xcb-glx)
+ $(LIBDRM_LIB) $(shell $(PKG_CONFIG) --libs xcb) $(shell $(PKG_CONFIG) --libs x11-xcb) $(shell $(PKG_CONFIG) --libs xcb-glx)
SRC_DIRS = glx gallium mesa glu
MESA_MODULES = $(TOP)/src/mesa/libmesa.a
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
-LIBDRM_LIB = $(shell pkg-config --libs libdrm)
+LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
+LIBDRM_LIB = $(shell $(PKG_CONFIG) --libs libdrm)
DRI_LIB_DEPS = $(MESA_MODULES) $(EXTRA_LIB_PATH) -lm -lpthread -lexpat -ldl $(LIBDRM_LIB)
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lXxf86vm -lXdamage -lXfixes \
-lm -lpthread -ldl \
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -lstdc++
# to allow the NV drivers to compile
-LIBDRM_CFLAGS = $(shell pkg-config --cflags libdrm)
+LIBDRM_CFLAGS = $(shell $(PKG_CONFIG) --cflags libdrm)
-I$(TOP)/include
# Generate protocol sources
-prefix=$(shell pkg-config --variable=prefix wayland-server)
-exec_prefx=$(shell pkg-config --variable=exec_prefix wayland-server)
+prefix=$(shell $(PKG_CONFIG) --variable=prefix wayland-server)
+exec_prefx=$(shell $(PKG_CONFIG) --variable=exec_prefix wayland-server)
wayland_protocoldir = $(PWD)/protocol
wayland_scanner=$(exec_prefix)/bin/wayland-scanner
-I$(TOP)/src/gallium/state_trackers/dri/common \
-I$(TOP)/src/mesa/drivers/dri/common \
-I$(TOP)/src/mesa/main \
- $(shell pkg-config --cflags-only-I libdrm)
+ $(shell $(PKG_CONFIG) --cflags-only-I libdrm)
C_SOURCES = \
-I$(TOP)/src/mapi \
-I$(TOP)/src/mesa \
$(X11_CFLAGS) \
- $(shell pkg-config --cflags-only-I libdrm dri2proto)
+ $(shell $(PKG_CONFIG) --cflags-only-I libdrm dri2proto)
x11_SOURCES = $(wildcard x11/*.c) \
$(TOP)/src/glx/dri2.c
-I$(TOP)/src/gallium/winsys \
-I$(TOP)/src/egl/wayland/wayland-egl \
-I$(TOP)/src/egl/wayland/wayland-drm \
- $(shell pkg-config --cflags-only-I libdrm wayland-client)
+ $(shell $(PKG_CONFIG) --cflags-only-I libdrm wayland-client)
wayland_SOURCES = $(wildcard wayland/*.c)
wayland_OBJECTS = $(wayland_SOURCES:.c=.o)
-drm_INCLUDES = -I$(TOP)/src/gallium/winsys $(shell pkg-config --cflags-only-I libdrm) \
+drm_INCLUDES = -I$(TOP)/src/gallium/winsys $(shell $(PKG_CONFIG) --cflags-only-I libdrm)
-I$(TOP)/src/gbm/main -I$(TOP)/src/gallium/state_trackers/gbm
drm_SOURCES = $(wildcard drm/*.c)
drm_OBJECTS = $(drm_SOURCES:.c=.o)
LIBRARY_DEFINES = -DVER_MAJOR=$(VA_MAJOR) -DVER_MINOR=$(VA_MINOR) $(STATE_TRACKER_DEFINES)
LIBRARY_INCLUDES = \
- $(shell pkg-config --cflags-only-I libva) \
+ $(shell $(PKG_CONFIG) --cflags-only-I libva) \
-I$(TOP)/src/gallium/winsys/g3dvl
C_SOURCES = htab.c \
LIBRARY_DEFINES = -DVER_MAJOR=$(VDPAU_MAJOR) -DVER_MINOR=$(VDPAU_MINOR) $(STATE_TRACKER_DEFINES)
LIBRARY_INCLUDES = \
- $(shell pkg-config --cflags-only-I vdpau) \
+ $(shell $(PKG_CONFIG) --cflags-only-I vdpau) \
-I$(TOP)/src/gallium/winsys/g3dvl
C_SOURCES = htab.c \
LIBRARY_INCLUDES = \
-DHAVE_CONFIG_H \
- $(shell pkg-config xextproto --atleast-version=7.0.99.1 \
+ $(shell $(PKG_CONFIG) xextproto --atleast-version=7.0.99.1 \
&& echo "-DHAVE_XEXTPROTO_71") \
- $(shell pkg-config libkms --atleast-version=1.0 \
+ $(shell $(PKG_CONFIG) libkms --atleast-version=1.0 \
&& echo "-DHAVE_LIBKMS") \
- $(shell pkg-config libkms --silence-errors --cflags-only-I) \
- $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto dri2proto) \
+ $(shell $(PKG_CONFIG) libkms --silence-errors --cflags-only-I) \
+ $(shell $(PKG_CONFIG) --cflags-only-I pixman-1 xorg-server libdrm xproto dri2proto) \
-I$(TOP)/src/gallium/include \
-I$(TOP)/src/gallium/auxiliary \
-I$(TOP)/include \
LIBNAME = xvmctracker
LIBRARY_INCLUDES = \
- $(shell pkg-config --cflags-only-I xvmc) \
+ $(shell $(PKG_CONFIG) --cflags-only-I xvmc) \
-I$(TOP)/src/gallium/winsys/g3dvl
C_SOURCES = block.c \
$(ASM_SOURCES:.S=.o)
INCLUDES = \
- $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \
+ $(shell $(PKG_CONFIG) --cflags-only-I pixman-1 xorg-server libdrm xproto) \
-I$(TOP)/src/gallium/include \
-I$(TOP)/src/gallium/drivers \
-I$(TOP)/src/gallium/auxiliary \
include ../Makefile.dri
-DRI_LIB_DEPS += $(shell pkg-config libdrm_nouveau --libs)
+DRI_LIB_DEPS += $(shell $(PKG_CONFIG) libdrm_nouveau --libs)
symlinks:
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
-DRIVER_LIBS = $(shell pkg-config libdrm --libs) -lXfixes
+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes
include ../Makefile.va
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
-DRIVER_LIBS = $(shell pkg-config libdrm --libs) -lXfixes
+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes
include ../Makefile.va
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
-DRIVER_LIBS = $(shell pkg-config libdrm --libs) -lXfixes
+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes
include ../Makefile.vdpau
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
-DRIVER_LIBS = $(shell pkg-config libdrm --libs) -lXfixes
+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes
include ../Makefile.vdpau
$(TOP)/src/gallium/drivers/rbug/librbug.a
DRIVER_LINKS = \
- $(shell pkg-config --libs libdrm libdrm_intel)
+ $(shell $(PKG_CONFIG) --libs libdrm libdrm_intel)
include ../Makefile.xorg
$(TOP)/src/gallium/drivers/softpipe/libsoftpipe.a
DRIVER_LINKS = \
- $(shell pkg-config --libs libdrm libdrm_intel)
+ $(shell $(PKG_CONFIG) --libs libdrm libdrm_intel)
include ../Makefile.xorg
$(TOP)/src/gallium/drivers/rbug/librbug.a
DRIVER_LINKS = \
- $(shell pkg-config --libs libdrm libdrm_nouveau)
+ $(shell $(PKG_CONFIG) --libs libdrm libdrm_nouveau)
DRIVER_INCLUDES = \
- $(shell pkg-config --cflags-only-I libdrm libdrm_nouveau xf86driproto)
+ $(shell $(PKG_CONFIG) --cflags-only-I libdrm libdrm_nouveau xf86driproto)
include ../Makefile.xorg
$(TOP)/src/gallium/drivers/rbug/librbug.a
DRIVER_LINKS = \
- $(shell pkg-config --libs libdrm)
+ $(shell $(PKG_CONFIG) --libs libdrm)
include ../Makefile.xorg
$(TOP)/src/gallium/drivers/rbug/librbug.a
DRIVER_LINKS = \
- $(shell pkg-config --libs libdrm)
+ $(shell $(PKG_CONFIG) --libs libdrm)
include ../Makefile.xorg
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
-DRIVER_LIBS = $(shell pkg-config libdrm_nouveau --libs) -lXfixes
+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm_nouveau --libs) -lXfixes
include ../Makefile.xvmc
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
-DRIVER_LIBS = $(shell pkg-config libdrm --libs) -lXfixes
+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes
include ../Makefile.xvmc
$(COMMON_GALLIUM_SOURCES) \
$(DRIVER_SOURCES)
-DRIVER_LIBS = $(shell pkg-config libdrm --libs) -lXfixes
+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes
include ../Makefile.xvmc
LIBNAME = vldri
LIBRARY_INCLUDES = -I$(TOP)/src/gallium/winsys/g3dvl \
- $(shell pkg-config libdrm --cflags-only-I)
+ $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
C_SOURCES = \
driclient.c \
# get C_SOURCES
include Makefile.sources
-LIBRARY_INCLUDES = $(shell pkg-config libdrm --cflags-only-I)
+LIBRARY_INCLUDES = $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
-LIBRARY_DEFINES = $(shell pkg-config libdrm --cflags-only-other)
+LIBRARY_DEFINES = $(shell $(PKG_CONFIG) libdrm --cflags-only-other)
include ../../../Makefile.template
i965_drm_buffer.c \
i965_drm_winsys.c
-LIBRARY_INCLUDES = $(shell pkg-config libdrm --cflags-only-I)
+LIBRARY_INCLUDES = $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
-LIBRARY_DEFINES = $(shell pkg-config libdrm --cflags-only-other)
+LIBRARY_DEFINES = $(shell $(PKG_CONFIG) --cflags-only-other)
include ../../../Makefile.template
C_SOURCES = nouveau_drm_winsys.c
-LIBRARY_INCLUDES = $(shell pkg-config libdrm libdrm_nouveau --cflags-only-I)
-LIBRARY_DEFINES = $(shell pkg-config libdrm libdrm_nouveau --cflags-only-other)
+LIBRARY_INCLUDES = $(shell $(PKG_CONFIG) libdrm libdrm_nouveau --cflags-only-I)
+LIBRARY_DEFINES = $(shell $(PKG_CONFIG) libdrm libdrm_nouveau --cflags-only-other)
include ../../../Makefile.template
include Makefile.sources
LIBRARY_INCLUDES = -I$(TOP)/include \
- $(shell pkg-config libdrm --cflags-only-I)
+ $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
include ../../../Makefile.template
LIBRARY_INCLUDES = \
-I$(TOP)/src/gallium/drivers/svga \
-I$(TOP)/src/gallium/drivers/svga/include \
- $(shell pkg-config libdrm --cflags-only-I)
+ $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
LIBRARY_DEFINES = \
-std=gnu99 -fvisibility=hidden \
-DHAVE_STDINT_H -D_FILE_OFFSET_BITS=64 \
- $(shell pkg-config libdrm --cflags-only-other)
+ $(shell $(PKG_CONFIG) libdrm --cflags-only-other)
include ../../../Makefile.template
ASM_SOURCES =
DRIVER_DEFINES = $(addprefix -I$(TOP)/, $(i915_INCLUDES)) -DI915 \
- $(shell pkg-config libdrm --atleast-version=2.3.1 \
+ $(shell $(PKG_CONFIG) libdrm --atleast-version=2.3.1 \
&& echo "-DDRM_VBLANK_FLIP=DRM_VBLANK_FLIP")
INCLUDES += $(INTEL_CFLAGS)