1348 |
21 Jun 08 |
peter |
# $Id$ |
1348 |
21 Jun 08 |
peter |
2 |
|
2119 |
12 Dec 09 |
peter |
# Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
4359 |
23 Aug 23 |
peter |
# Copyright (C) 2009, 2010, 2011, 2013, 2015, 2017, 2019 Peter Johansson |
1348 |
21 Jun 08 |
peter |
5 |
# |
1469 |
02 Sep 08 |
peter |
# This file is part of the yat library, http://dev.thep.lu.se/yat |
1348 |
21 Jun 08 |
peter |
7 |
# |
1348 |
21 Jun 08 |
peter |
# The yat library is free software; you can redistribute it and/or |
1348 |
21 Jun 08 |
peter |
# modify it under the terms of the GNU General Public License as |
1486 |
09 Sep 08 |
jari |
# published by the Free Software Foundation; either version 3 of the |
1348 |
21 Jun 08 |
peter |
# License, or (at your option) any later version. |
1348 |
21 Jun 08 |
peter |
12 |
# |
1348 |
21 Jun 08 |
peter |
# The yat library is distributed in the hope that it will be useful, |
1348 |
21 Jun 08 |
peter |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1348 |
21 Jun 08 |
peter |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1348 |
21 Jun 08 |
peter |
# General Public License for more details. |
1348 |
21 Jun 08 |
peter |
17 |
# |
1348 |
21 Jun 08 |
peter |
# You should have received a copy of the GNU General Public License |
1487 |
10 Sep 08 |
jari |
# along with yat. If not, see <http://www.gnu.org/licenses/>. |
1348 |
21 Jun 08 |
peter |
20 |
|
1348 |
21 Jun 08 |
peter |
prefix="@prefix@" |
1348 |
21 Jun 08 |
peter |
exec_prefix="@exec_prefix@" |
1348 |
21 Jun 08 |
peter |
bindir="@bindir@" |
1348 |
21 Jun 08 |
peter |
libdir="@libdir@" |
1348 |
21 Jun 08 |
peter |
includedir="@includedir@" |
1348 |
21 Jun 08 |
peter |
26 |
|
1998 |
13 Jun 09 |
peter |
abs_top_builddir="@abs_top_builddir@" |
1998 |
13 Jun 09 |
peter |
abs_top_srcdir="@abs_top_srcdir@" |
1998 |
13 Jun 09 |
peter |
29 |
|
1697 |
06 Jan 09 |
peter |
installed=no |
1697 |
06 Jan 09 |
peter |
31 |
|
3716 |
10 Nov 17 |
peter |
host_os="@host_os@" |
3716 |
10 Nov 17 |
peter |
GXX="@GXX@" |
1348 |
21 Jun 08 |
peter |
CXX="@CXX@" |
1348 |
21 Jun 08 |
peter |
CXXCPP="@CXXCPP@" |
1348 |
21 Jun 08 |
peter |
CPPFLAGS="@CPPFLAGS@" |
1348 |
21 Jun 08 |
peter |
CXXFLAGS="@CXXFLAGS@" |
1348 |
21 Jun 08 |
peter |
LDFLAGS="@LDFLAGS@" |
1348 |
21 Jun 08 |
peter |
LIBS="@LIBS@" |
1892 |
13 Apr 09 |
peter |
YAT_CPPFLAGS="@YAT_CPPFLAGS@" |
1892 |
13 Apr 09 |
peter |
YAT_CXXFLAGS="@YAT_CXXFLAGS@" |
1892 |
13 Apr 09 |
peter |
YAT_LDFLAGS="@YAT_LDFLAGS@" |
1897 |
15 Apr 09 |
peter |
YAT_PRIMARY_LIBS="@YAT_PRIMARY_LIBS@" |
3111 |
10 Nov 13 |
peter |
YAT_STATIC_LIBS="@YAT_STATIC_LIBS@" |
1897 |
15 Apr 09 |
peter |
LIBM="@LIBM@" |
3715 |
10 Nov 17 |
peter |
# let user override these four variables |
3715 |
10 Nov 17 |
peter |
: ${YAT_CONFIG_CPPFLAGS="@YAT_CONFIG_CPPFLAGS@"} |
3715 |
10 Nov 17 |
peter |
: ${YAT_CONFIG_CXXFLAGS="@YAT_CONFIG_CXXFLAGS@"} |
3715 |
10 Nov 17 |
peter |
: ${YAT_CONFIG_LDFLAGS="@YAT_CONFIG_LDFLAGS@"} |
3715 |
10 Nov 17 |
peter |
: ${YAT_CBLAS_LIB="@YAT_CBLAS_LIB@"} |
1348 |
21 Jun 08 |
peter |
51 |
|
2264 |
27 May 10 |
peter |
LA_FILE="$libdir/libyat.la" |
1697 |
06 Jan 09 |
peter |
if test x$installed = xno; then |
2264 |
27 May 10 |
peter |
LA_FILE="@abs_top_builddir@/yat/libyat.la" |
1697 |
06 Jan 09 |
peter |
fi |
1406 |
11 Aug 08 |
peter |
56 |
|
1348 |
21 Jun 08 |
peter |
usage() |
1348 |
21 Jun 08 |
peter |
58 |
{ |
1348 |
21 Jun 08 |
peter |
cat <<EOF |
1348 |
21 Jun 08 |
peter |
Usage: yat-config [OPTION]... |
1348 |
21 Jun 08 |
peter |
61 |
|
1348 |
21 Jun 08 |
peter |
Known values for OPTION are: |
1406 |
11 Aug 08 |
peter |
--prefix print prefix |
1406 |
11 Aug 08 |
peter |
--bindir print location where binaries are installed |
1406 |
11 Aug 08 |
peter |
--includedir print location where headers are installed |
1406 |
11 Aug 08 |
peter |
--libdir print location where @PACKAGE@ library is installed |
1406 |
11 Aug 08 |
peter |
--cxx print C++ compiler name |
1406 |
11 Aug 08 |
peter |
--cxxcpp print C++ preprocessor name and required options |
1406 |
11 Aug 08 |
peter |
--cppflags print C++ preprocessor flags |
1406 |
11 Aug 08 |
peter |
--cxxflags print C++ compiler flags |
1406 |
11 Aug 08 |
peter |
--ldflags print linker flags |
1406 |
11 Aug 08 |
peter |
--libs print libraries to link against |
1898 |
16 Apr 09 |
peter |
--libs-without-cblas print libraries to link against except cblas |
1406 |
11 Aug 08 |
peter |
--link-libtool print the libtool inputs for linking to @PACKAGE@ |
2020 |
04 Aug 09 |
peter |
--yat-la-file print the path to the .la file |
1408 |
13 Aug 08 |
peter |
--atleast-version=VERSION return 0 if @PACKAGE@ is at least version VERSION |
1406 |
11 Aug 08 |
peter |
--version print @PACKAGE@'s version |
1406 |
11 Aug 08 |
peter |
--version-major print @PACKAGE@'s MAJOR version |
2828 |
12 Sep 12 |
peter |
--version-minor print @PACKAGE@'s MINOR version |
2828 |
12 Sep 12 |
peter |
--version-patch print @PACKAGE@'s PATCH version |
3133 |
24 Nov 13 |
peter |
--help print this help and exit |
1348 |
21 Jun 08 |
peter |
82 |
|
3133 |
24 Nov 13 |
peter |
An alternative CBLAS library can be specified using the YAT_CBLAS_LIB |
3133 |
24 Nov 13 |
peter |
environment variable. The CBLAS library detected during configuration |
3133 |
24 Nov 13 |
peter |
is used by default (@YAT_CBLAS_LIB@). |
3133 |
24 Nov 13 |
peter |
86 |
|
1350 |
21 Jun 08 |
peter |
Report bugs to <@PACKAGE_BUGREPORT@>. |
3382 |
10 Mar 15 |
peter |
yat home page: <@PACKAGE_URL@> |
1348 |
21 Jun 08 |
peter |
EOF |
1348 |
21 Jun 08 |
peter |
90 |
|
1348 |
21 Jun 08 |
peter |
exit $1 |
1348 |
21 Jun 08 |
peter |
92 |
} |
1348 |
21 Jun 08 |
peter |
93 |
|
1348 |
21 Jun 08 |
peter |
94 |
|
1348 |
21 Jun 08 |
peter |
if test $# -eq 0; then |
1689 |
31 Dec 08 |
peter |
usage 1 |
1348 |
21 Jun 08 |
peter |
fi |
1348 |
21 Jun 08 |
peter |
98 |
|
3800 |
04 May 19 |
peter |
output="" |
1348 |
21 Jun 08 |
peter |
100 |
|
1348 |
21 Jun 08 |
peter |
while test $# -gt 0; do |
1348 |
21 Jun 08 |
peter |
case "$1" in |
1348 |
21 Jun 08 |
peter |
--prefix) |
3800 |
04 May 19 |
peter |
output="$output $prefix" |
1348 |
21 Jun 08 |
peter |
105 |
;; |
1348 |
21 Jun 08 |
peter |
--bindir) |
3800 |
04 May 19 |
peter |
output="$output $bindir" |
1348 |
21 Jun 08 |
peter |
108 |
;; |
1348 |
21 Jun 08 |
peter |
--includedir) |
3800 |
04 May 19 |
peter |
output="$output $includedir" |
1348 |
21 Jun 08 |
peter |
111 |
;; |
1423 |
20 Aug 08 |
peter |
--libdir) |
3800 |
04 May 19 |
peter |
output="$output $libdir" |
1423 |
20 Aug 08 |
peter |
114 |
;; |
1348 |
21 Jun 08 |
peter |
--cxx) |
3800 |
04 May 19 |
peter |
output="$output $CXX" |
1348 |
21 Jun 08 |
peter |
117 |
;; |
1348 |
21 Jun 08 |
peter |
--cxxcpp) |
3800 |
04 May 19 |
peter |
output="$output $CXXCPP" |
1348 |
21 Jun 08 |
peter |
120 |
;; |
1348 |
21 Jun 08 |
peter |
--cppflags) |
1697 |
06 Jan 09 |
peter |
if test $installed = yes; then |
3716 |
10 Nov 17 |
peter |
# add $includedir unless |
3716 |
10 Nov 17 |
peter |
# 1) $includedir is /usr/include or |
3716 |
10 Nov 17 |
peter |
# 2) $includedir is /usr/local/include on linux |
3716 |
10 Nov 17 |
peter |
add_path=yes |
1857 |
07 Mar 09 |
peter |
if test "x$includedir" = "x/usr/include"; then |
3716 |
10 Nov 17 |
peter |
add_path=no |
3716 |
10 Nov 17 |
peter |
elif (test "x$includedir" = "x/usr/local/include" && |
3716 |
10 Nov 17 |
peter |
test x"$GXX" = x"yes"); then |
3716 |
10 Nov 17 |
peter |
case $host_os in |
3716 |
10 Nov 17 |
peter |
linux* | gnu* | k*bsd*-gnu) add_path=no;; |
3716 |
10 Nov 17 |
peter |
esac |
3716 |
10 Nov 17 |
peter |
fi |
3716 |
10 Nov 17 |
peter |
if test x"$add_path" = x"yes"; then |
3800 |
04 May 19 |
peter |
output="$output -I$includedir" |
1857 |
07 Mar 09 |
peter |
fi |
2828 |
12 Sep 12 |
peter |
else |
1998 |
13 Jun 09 |
peter |
# For VPATH build we need to add path to some generated files |
1998 |
13 Jun 09 |
peter |
# The second part is to allow header files in `yat/utility' to |
1998 |
13 Jun 09 |
peter |
# include generated files simply as "generated.h". |
1998 |
13 Jun 09 |
peter |
if test "x$abs_top_builddir" != "x$abs_top_srcdir"; then |
3800 |
04 May 19 |
peter |
output="$output -I$abs_top_builddir" |
3800 |
04 May 19 |
peter |
output="$output -I$abs_top_builddir/yat/utility" |
1998 |
13 Jun 09 |
peter |
fi |
3800 |
04 May 19 |
peter |
output="$output -I$abs_top_srcdir" |
1697 |
06 Jan 09 |
peter |
fi |
3800 |
04 May 19 |
peter |
output="$output $YAT_CPPFLAGS $CPPFLAGS $YAT_CONFIG_CPPFLAGS" |
1348 |
21 Jun 08 |
peter |
149 |
;; |
1348 |
21 Jun 08 |
peter |
--cxxflags) |
3800 |
04 May 19 |
peter |
output="$output $YAT_CXXFLAGS $CXXFLAGS $YAT_CONFIG_CXXFLAGS" |
1348 |
21 Jun 08 |
peter |
152 |
;; |
1348 |
21 Jun 08 |
peter |
--libs) |
3800 |
04 May 19 |
peter |
output="$output -lyat $YAT_STATIC_LIBS $YAT_PRIMARY_LIBS $YAT_CBLAS_LIB $LIBM $LIBS" |
1348 |
21 Jun 08 |
peter |
155 |
;; |
1898 |
16 Apr 09 |
peter |
--libs-without-cblas) |
3800 |
04 May 19 |
peter |
output="$output -lyat $YAT_STATIC_LIBS $YAT_PRIMARY_LIBS $LIBM $LIBS" |
1898 |
16 Apr 09 |
peter |
158 |
;; |
1348 |
21 Jun 08 |
peter |
--ldflags) |
1857 |
07 Mar 09 |
peter |
if test "x$libdir" = "x/usr/lib"; then |
1857 |
07 Mar 09 |
peter |
: # ignore standard '/usr/lib' |
2828 |
12 Sep 12 |
peter |
elif (test "$CXX" = "g++" && |
2217 |
14 Mar 10 |
peter |
test "x$libdir" = "x/usr/local/lib"); then |
1857 |
07 Mar 09 |
peter |
: # ignore '/usr/local/lib' if we use g++ |
1857 |
07 Mar 09 |
peter |
else |
3800 |
04 May 19 |
peter |
output="$output -L$libdir" |
1857 |
07 Mar 09 |
peter |
fi |
3800 |
04 May 19 |
peter |
output="$output $YAT_LDFLAGS $LDFLAGS $YAT_CONFIG_LDFLAGS" |
1348 |
21 Jun 08 |
peter |
169 |
;; |
1370 |
14 Jul 08 |
peter |
--link-libtool) |
3800 |
04 May 19 |
peter |
output="$output $LA_FILE $YAT_STATIC_LIBS $YAT_CBLAS_LIB" |
1370 |
14 Jul 08 |
peter |
172 |
;; |
2020 |
04 Aug 09 |
peter |
--yat-la-file) |
3800 |
04 May 19 |
peter |
output="$output $LA_FILE" |
2020 |
04 Aug 09 |
peter |
175 |
;; |
1406 |
11 Aug 08 |
peter |
--atleast-version=*) |
2266 |
05 Jun 10 |
peter |
optarg=`echo "$1" | sed 's/--atleast-version=//'` |
2266 |
05 Jun 10 |
peter |
min_major=`echo "$optarg" | sed 's/\([0-9]*\).*/\1/'` |
1406 |
11 Aug 08 |
peter |
if test "$optarg" = "$min_major"; then |
1406 |
11 Aug 08 |
peter |
min_minor="0"; |
1406 |
11 Aug 08 |
peter |
else |
2266 |
05 Jun 10 |
peter |
min_minor=`echo "$optarg" | sed 's/[0-9]*.\([0-9]*\).*/\1/'` |
1406 |
11 Aug 08 |
peter |
fi |
1406 |
11 Aug 08 |
peter |
if test "$optarg" = "$min_major.$min_minor"; then |
1406 |
11 Aug 08 |
peter |
min_patch="0"; |
1406 |
11 Aug 08 |
peter |
else |
2266 |
05 Jun 10 |
peter |
min_patch=`echo "$optarg" | sed 's/[0-9]*.[0-9]*.\([0-9]*\).*/\1/'` |
1406 |
11 Aug 08 |
peter |
fi |
1406 |
11 Aug 08 |
peter |
if test "$optarg" = "$min_patch"; then |
2828 |
12 Sep 12 |
peter |
echo "yat-config: \`$optarg' is not a valid VERSION" |
1406 |
11 Aug 08 |
peter |
exit 255 |
1406 |
11 Aug 08 |
peter |
fi |
1406 |
11 Aug 08 |
peter |
if !(test -n "$min_major" && test -n "$min_minor" \ |
2828 |
12 Sep 12 |
peter |
&& test -n "$min_patch"); then |
2828 |
12 Sep 12 |
peter |
echo "yat-config: \`$optarg' is not a valid VERSION" |
1406 |
11 Aug 08 |
peter |
exit 255 |
1406 |
11 Aug 08 |
peter |
fi |
1406 |
11 Aug 08 |
peter |
if ( test $min_major -gt @YAT_MAJOR_VERSION@ || \ |
1406 |
11 Aug 08 |
peter |
( test $min_major -eq @YAT_MAJOR_VERSION@ && \ |
1406 |
11 Aug 08 |
peter |
( test $min_minor -gt @YAT_MINOR_VERSION@ || \ |
2474 |
13 Apr 11 |
peter |
( test $min_minor -eq @YAT_MINOR_VERSION@ && \ |
1406 |
11 Aug 08 |
peter |
( test $min_patch -gt @YAT_PATCH_VERSION@ || |
2828 |
12 Sep 12 |
peter |
(test $min_patch -eq @YAT_PATCH_VERSION@ && |
1406 |
11 Aug 08 |
peter |
test "@YAT_DEV_BUILD@" = "true" )))))) ; then |
2474 |
13 Apr 11 |
peter |
exit 1; |
1406 |
11 Aug 08 |
peter |
fi |
1406 |
11 Aug 08 |
peter |
exit 0 |
1406 |
11 Aug 08 |
peter |
208 |
;; |
1348 |
21 Jun 08 |
peter |
--version) |
2266 |
05 Jun 10 |
peter |
echo @VERSION@ |
1348 |
21 Jun 08 |
peter |
exit 0 |
1348 |
21 Jun 08 |
peter |
212 |
;; |
1348 |
21 Jun 08 |
peter |
--version-major) |
2266 |
05 Jun 10 |
peter |
echo @YAT_MAJOR_VERSION@ |
1348 |
21 Jun 08 |
peter |
exit 0 |
1348 |
21 Jun 08 |
peter |
216 |
;; |
1348 |
21 Jun 08 |
peter |
--version-minor) |
2266 |
05 Jun 10 |
peter |
echo @YAT_MINOR_VERSION@ |
1348 |
21 Jun 08 |
peter |
exit 0 |
1348 |
21 Jun 08 |
peter |
220 |
;; |
1348 |
21 Jun 08 |
peter |
--version-patch) |
2266 |
05 Jun 10 |
peter |
echo @YAT_PATCH_VERSION@ |
1348 |
21 Jun 08 |
peter |
exit 0 |
1348 |
21 Jun 08 |
peter |
224 |
;; |
1348 |
21 Jun 08 |
peter |
--help) |
1689 |
31 Dec 08 |
peter |
usage 0 |
1348 |
21 Jun 08 |
peter |
227 |
;; |
1348 |
21 Jun 08 |
peter |
228 |
*) |
2473 |
13 Apr 11 |
peter |
echo "yat-config: unrecognized option '$1'" >&2 |
2473 |
13 Apr 11 |
peter |
echo "Try \`yat-config --help' for more information." >&2 |
2473 |
13 Apr 11 |
peter |
exit 1 |
1348 |
21 Jun 08 |
peter |
232 |
;; |
1348 |
21 Jun 08 |
peter |
esac |
1348 |
21 Jun 08 |
peter |
234 |
|
1348 |
21 Jun 08 |
peter |
# Next please. |
1348 |
21 Jun 08 |
peter |
shift |
1348 |
21 Jun 08 |
peter |
done |
1348 |
21 Jun 08 |
peter |
238 |
|
3800 |
04 May 19 |
peter |
echo $output |
1348 |
21 Jun 08 |
peter |
exit 0 |