From 7c59d8ccd2155e4184eccc76da99094d8f63d5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 22 Apr 2019 16:13:09 +0200 Subject: Use pkg-config to get values in libart2-config. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- Makefile.am | 4 --- configure.in | 1 - libart-2.0-uninstalled.pc.in | 2 +- libart-2.0.pc.in | 2 +- libart-config.in | 65 ------------------------------------------ libart2-config | 68 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 70 insertions(+), 72 deletions(-) delete mode 100644 libart-config.in create mode 100644 libart2-config diff --git a/Makefile.am b/Makefile.am index aec6c5d..a7399d1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,6 @@ art_config.h: EXTRA_DIST = \ libart.def \ - libart-config.in \ libart-2.0.pc.in \ libart-2.0-uninstalled.pc.in @@ -166,9 +165,6 @@ tests: testart testuta pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libart-2.0.pc -libart2-config: libart-config - cp -f libart-config libart2-config - install-data-local: install-ms-lib install-libtool-import-lib uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib diff --git a/configure.in b/configure.in index 0010d48..ba44d56 100644 --- a/configure.in +++ b/configure.in @@ -108,7 +108,6 @@ libart-2.0.pc libart-2.0-uninstalled.pc libart-zip]) -AC_CONFIG_FILES([libart-config],[chmod +x libart-config]) AC_CONFIG_FILES([gen_art_config.sh],[chmod +x gen_art_config.sh]) AC_OUTPUT diff --git a/libart-2.0-uninstalled.pc.in b/libart-2.0-uninstalled.pc.in index f731e54..6dddc9d 100644 --- a/libart-2.0-uninstalled.pc.in +++ b/libart-2.0-uninstalled.pc.in @@ -5,6 +5,6 @@ includedir=@includedir@ Name: libart Description: LGPL version of the libart library -Version: @VERSION@ +Version: @LIBART_VERSION@ Libs: ${pc_top_builddir}/${pcfiledir}/libart_lgpl_2.la Cflags: -I${pc_top_builddir}/${pcfiledir} diff --git a/libart-2.0.pc.in b/libart-2.0.pc.in index 1df143b..063e1f5 100644 --- a/libart-2.0.pc.in +++ b/libart-2.0.pc.in @@ -5,6 +5,6 @@ includedir=@includedir@ Name: libart Description: LGPL version of the libart library -Version: @VERSION@ +Version: @LIBART_VERSION@ Libs: -L${libdir} -lart_lgpl_2 Cflags: -I${includedir}/libart-2.0 diff --git a/libart-config.in b/libart-config.in deleted file mode 100644 index e32f010..0000000 --- a/libart-config.in +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -exec_prefix_set=no -libs="" -output_libs=no - -usage="\ -Usage: libart-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]" - -if test $# -eq 0; then - echo "${usage}" 1>&2 - exit 1 -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --prefix=*) - prefix=$optarg - if test $exec_prefix_set = no ; then - exec_prefix=$optarg - fi - ;; - --prefix) - echo $prefix - ;; - --exec-prefix=*) - exec_prefix=$optarg - exec_prefix_set=yes - ;; - --exec-prefix) - echo $exec_prefix - ;; - --version) - echo @LIBART_VERSION@ - ;; - --cflags) - includes=-I@includedir@/libart-2.0 - echo $includes - ;; - --libs) - libs="$libs -L@libdir@ -lart_lgpl_2" - output_libs=yes - ;; - --static) - libs="$libs -lm" - ;; - *) - echo "${usage}" 1>&2 - exit 1 - ;; - esac - shift -done - -if test $output_libs = yes ; then - echo $libs -fi - diff --git a/libart2-config b/libart2-config new file mode 100644 index 0000000..2d97c61 --- /dev/null +++ b/libart2-config @@ -0,0 +1,68 @@ +#!/bin/sh + +usage="\ +Usage: libart2-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]" + +if test $# -eq 0; then + echo "${usage}" 1>&2 + exit 1 +fi + +if ! which pkg-config >/dev/null; then + echo "pkg-config not found on your system" 1>&2 + exit 1 +fi + +prefix=`pkg-config --variable=prefix libart-2.0` +exec_prefix=`pkg-config --variable=exec_prefix libart-2.0` +exec_prefix_set=no +libs="" +output_libs=no + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + if test $exec_prefix_set = no ; then + exec_prefix=$optarg + fi + ;; + --prefix) + echo $prefix + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + ;; + --exec-prefix) + echo $exec_prefix + ;; + --version) + echo `pkg-config --modversion libart-2.0` + ;; + --cflags) + echo `pkg-config --cflags-only-I libart-2.0` + ;; + --libs) + libs=`pkg-config --libs libart-2.0` + output_libs=yes + ;; + --static) + libs="$libs -lm" + ;; + *) + echo "${usage}" 1>&2 + exit 1 + ;; + esac + shift +done + +if test $output_libs = yes ; then + echo $libs +fi -- cgit v1.2.1