summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@kodafritt.se>2014-04-10 19:20:19 +0200
committerSamuel Lidén Borell <samuel@kodafritt.se>2014-04-10 19:20:19 +0200
commit7bd491c7a8f70e76e22c499b675d33eced1a4b7a (patch)
tree972bc2e44edd8659fb853cc1f95ce05f2e427725 /configure
parent12a4d4c31e26666025488c658fb9a5b8fdbd57ed (diff)
downloadfribid-7bd491c7a8f70e76e22c499b675d33eced1a4b7a.tar.gz
fribid-7bd491c7a8f70e76e22c499b675d33eced1a4b7a.tar.bz2
fribid-7bd491c7a8f70e76e22c499b675d33eced1a4b7a.zip
Fix compatibility with BSD Make
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 23 insertions, 1 deletions
diff --git a/configure b/configure
index b8fd735..2e70f8b 100755
--- a/configure
+++ b/configure
@@ -81,6 +81,10 @@ error=""
basedir=`dirname "$0"`
+getconfig() {
+ printf '#define CALLED_FROM_CONFIGURE\n#include "%s"\n%s\n' "$basedir/common/defines.h" "$1" | cpp - | sed 's/#.*$//g' | tr -d '\n' | sed 's/" "//g' | tr -d '\"'
+}
+
while [ "$#" != "0" ]; do
flag="$1"
shift
@@ -188,9 +192,27 @@ Options:
--internal--get-define=*)
name=${flag#--internal--get-define=}
[ ! -r "$basedir/common/config.h" ] && exit 1 # Exit if not configured yet
- printf '#define CALLED_FROM_CONFIGURE\n#include "%s"\n%s\n' "$basedir/common/defines.h" "$name" | cpp - | sed 's/#.*$//g' | tr -d '\n' | sed 's/" "//g' | tr -d '\"'
+ getconfig "$name"
exit 0
;;
+ --internal--get-pc-cflags|--internal--get-pc-libs)
+ [ ! -r "$basedir/common/config.h" ] && exit 1
+ gtk2libs=$([ "x`getconfig WITH_GTK2`" = "x1" ] && echo "'gtk+-2.0 >= 2.18' gdk-2.0")
+ gtk3libs=$([ "x`getconfig WITH_GTK3`" = "x1" ] && echo "gtk+-3.0")
+ pkcs11libs=$([ "x`getconfig ENABLE_PKCS11`" = "x1" ] && echo "libp11")
+ if [ "x$flag" = "x--internal--get-pc-cflags" ]; then
+ flags="--cflags"
+ else
+ flags="--libs --cflags"
+ fi
+ pkg-config $flags glib-2.0 gthread-2.0 libcrypto $gtk2libs $gtk3libs $pkcs11libs
+ exit
+ ;;
+ --internal--list-extra-objects)
+ [ ! -r "$basedir/common/config.h" ] && exit 1
+ [ "x`getconfig ENABLE_PKCS11`" = "x1" ] && echo "pkcs11.o"
+ exit
+ ;;
--internal--remove-link)
link="$1"
target="$2"