summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 8eb1d523b6c872931347711a5be7c6d1f9b9198b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
pkg_config_LDADD=@GLIB_LIBS@

if INTERNAL_GLIB
GLIB_SUBDIR = glib
endif

if USE_INSTALLED_POPT
pkg_config_LDADD += $(POPT_LIBS)
else
pkg_config_LDADD += popt/libpopt.la
popt_includes = -I$(top_srcdir)/popt
POPT_SUBDIR = popt
endif

SUBDIRS = $(GLIB_SUBDIR) $(POPT_SUBDIR) . check

m4dir = $(datadir)/aclocal
m4_DATA = pkg.m4

dist_doc_DATA = pkg-config-guide.html

man_MANS = pkg-config.1
EXTRA_DIST = $(m4_DATA) $(man_MANS) README.win32

bin_PROGRAMS = pkg-config
AM_CFLAGS=@WARN_CFLAGS@

if NATIVE_WIN32
INCLUDES= \
	-DPKG_CONFIG_PC_PATH="\"$(subst /,\/,$(pc_path))\"" \
	-DPKG_CONFIG_SYSTEM_INCLUDE_PATH="\"$(subst /,\/,$(system_include_path))\"" \
	-DPKG_CONFIG_SYSTEM_LIBRARY_PATH="\"$(subst /,\/,$(system_library_path))\"" \
	@GLIB_CFLAGS@ \
	$(popt_includes)
else
INCLUDES= \
	-DPKG_CONFIG_PC_PATH="\"$(pc_path)\"" \
	-DPKG_CONFIG_SYSTEM_INCLUDE_PATH="\"$(system_include_path)\"" \
	-DPKG_CONFIG_SYSTEM_LIBRARY_PATH="\"$(system_library_path)\"" \
	@GLIB_CFLAGS@ \
	$(popt_includes)
endif

pkg_config_SOURCES= \
	pkg.h \
	pkg.c \
	parse.h \
	parse.c \
	main.c
DISTCHECK_CONFIGURE_FLAGS = --with-installed-popt --with-internal-glib

# Override the normal dist so that we can make sure the glib subdir is
# configured first. Otherwise it will just bomb entering the directory.
dist dist-all: check-glib-Makefile
	@$(MAKE) $(AM_MAKEFLAGS) dist-gzip
check-glib-Makefile:
	@if test ! -f glib/Makefile; then \
	  echo $(SHELL) $(top_srcdir)/configure --with-internal-glib; \
	  $(SHELL) $(top_srcdir)/configure --with-internal-glib; \
	fi