1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-02 14:15:46 +01:00

Fix path substitutions

Autoconf uses multiple levels of variables when defining paths. For
example, ${datadir} by default is ${datarootdir}, which by default is
${prefix}/share, which by default is /usr/local. Substituting from
./configure, as is done by AC_DEFINE or AC_DEFINE_UNQUOTED, does not
expand all these variables. This was causing some of our defines to have
garbage like "${prefix}/share/pixmaps" rather than the intended
"/usr/local/share/pixmaps".

The solution is to generate the files needing these paths from the
Makefile rather than from ./configure, because make does fully expand
all those levels.

Signed-off-by: Brad Jorsch <anomie@users.sourceforge.net>
This commit is contained in:
Brad Jorsch
2010-09-29 16:12:33 -04:00
committed by Carlos R. Mafra
parent f6080ffd56
commit 060ba6a9cd
17 changed files with 193 additions and 163 deletions

View File

@@ -4,7 +4,7 @@ SUBDIRS = .
AUTOMAKE_OPTIONS =
EXTRA_DIST = tests libwraster.map
EXTRA_DIST = tests libwraster.map get-wraster-flags.in
lib_LTLIBRARIES = libwraster.la
@@ -49,7 +49,24 @@ INCLUDES = $(DFLAGS) @HEADER_SEARCH_PATH@
libwraster_la_LIBADD = @LIBRARY_SEARCH_PATH@ @GFXLIBS@ @XLIBS@ @LIBXMU@ -lm
DISTCLEANFILES = wrlib.pc
DISTCLEANFILES = wrlib.pc get-wraster-flags
wrlib.pc: Makefile
@echo "Generating $@"
@echo 'Name: wrlib' > $@
@echo 'Description: Image manipulation and conversion library' >> $@
@echo 'Version: $(VERSION)' >> $@
@echo 'Libs: $(lib_search_path) -lwraster $(GFXLIBS) $(XLIBS) -lm' >> $@
@echo 'Cflags: $(inc_search_path)' >> $@
get-wraster-flags: get-wraster-flags.in Makefile
@echo "Generating $@"
@$(SED) -e 's#$${inc_search_path}#$(inc_search_path)#;' \
-e 's#$${lib_search_path}#$(lib_search_path)#;' \
-e 's#$${GFXLIBS}#$(GFXLIBS)#;' \
-e 's#$${XLIBS}#$(XLIBS)#;' < $< > $@
@chmod 755 $@
install-exec-local:
@$(NORMAL_INSTALL)

View File

@@ -0,0 +1,31 @@
#!/bin/sh
WCFLAGS="${inc_search_path}"
WLFLAGS="${lib_search_path}"
WLIBS="-lwraster ${GFXLIBS} ${XLIBS} -lm"
usage="Usage: get-wraster-flags [--cflags] [--ldflags] [--libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case $1 in
--cflags)
echo $WCFLAGS
;;
--ldflags|--lflags)
echo $WLFLAGS
;;
--libs)
echo $WLIBS
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done