aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authornytpu <alex@nytpu.com>2021-05-22 13:56:33 -0600
committernytpu <alex@nytpu.com>2021-05-22 13:57:33 -0600
commit67958063af0bcc57669d2fef755822eb38ba4ad2 (patch)
tree58811fd40e1767b9e4d5d98d23b4a693fc8fc974 /configure
parentadd license header to README.7 (diff)
downloaded-67958063af0bcc57669d2fef755822eb38ba4ad2.tar.bz2
ed-67958063af0bcc57669d2fef755822eb38ba4ad2.zip
add pkg-config var to configure
Diffstat (limited to '')
-rwxr-xr-xconfigure24
1 files changed, 14 insertions, 10 deletions
diff --git a/configure b/configure
index 271c004..6ad7a73 100755
--- a/configure
+++ b/configure
@@ -19,14 +19,16 @@ set_macro() {
}
add_lib() {
- pkg-config --print-errors "$@"
- cflags $(pkg-config --cflags "$@")
- for lib in "$@"; do ldadd "$lib" $(pkg-config --libs "$lib"); done
+ ${pkgconfig} --print-errors "$@"
+ cflags $(${pkgconfig} --cflags "$@")
+ for lib in "$@"; do ldadd "$lib" $(${pkgconfig} --libs "$lib"); done
}
# save stdout and redirec to config.mk
exec >config.mk
+pkgconfig=pkg-config
+
echo "# Configuration for makefile for nytpu's implementation of ed(1)"
echo "# This file was generated automatically by configure. Don't edit."
@@ -37,13 +39,14 @@ for opt in "$@"; do
echo "Usage: $0 [--OPTION]..."
echo
echo "Options and variables: [defaults in brackets]"
- echo " -h, --help display this help text"
- echo " --prefix=DIR install into DIR [/usr]"
- echo " --bindir=DIR location to install executables [\$(PREFIX)/bin]"
- echo " --mandir=DIR location to install man pages [\$(PREFIX)/share/man]"
- echo " --cc=COMPILER command to invoke the C11 compiler [cc]"
- echo " --cflags=FLAGS command line options for the C compiler [-Wall -Wextra -Wfatal-errors -Wno-missing-field-initializers -Wno-unused-parameter -std=c11 -O2]"
- echo " --ldflags=FLAGS command line options for the linker []"
+ echo " -h, --help display this help text"
+ echo " --prefix=DIR install into DIR [/usr]"
+ echo " --bindir=DIR location to install executables [\$(PREFIX)/bin]"
+ echo " --mandir=DIR location to install man pages [\$(PREFIX)/share/man]"
+ echo " --cc=COMPILER command to invoke the C11 compiler [cc]"
+ echo " --cflags=FLAGS command line options for the C compiler [-Wall -Wextra -Wfatal-errors -Wno-missing-field-initializers -Wno-unused-parameter -std=c11 -O2]"
+ echo " --ldflags=FLAGS command line options for the linker []"
+ echo " --pkgconfig=COMMAND command to run to configure packages [pkg-config]"
;;
--prefix=*) echo "PREFIX = ${opt#*=}" ;;
--bindir=*) echo "BINDIR = ${opt#*=}" ;;
@@ -51,6 +54,7 @@ for opt in "$@"; do
--cc=*) echo "CC = ${opt#*=}" ;;
--cflags=*) echo "CFLAGS = ${opt#*=}" ;;
--ldflags=*) echo "LDFLAGS = ${opt#*=}" ;;
+ --pkg-config=*) pkgconfig=${opt#*=} ;;
*) echo "warning: unsupported option ${opt}" >&2 ;;
esac
done