-
Notifications
You must be signed in to change notification settings - Fork 2
/
apfelgrid-config.in
49 lines (38 loc) · 1.74 KB
/
apfelgrid-config.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /usr/bin/env bash
# These variables need to exist
prefix=@prefix@
exec_prefix=@exec_prefix@
if [[ $# -eq 0 || -n $( echo $* | egrep -- "--help|-h" ) ]]; then
echo
echo "apfelgrid-config: configuration tool for APFELgrid"
echo " webpage: https://github.com/nhartland/APFELgrid"
echo
echo "Usage: apfel-config [[--help|-h] | [--prefix] | [--ldflags]]"
echo "Options:"
echo " --help | -h : show this help message"
echo " --prefix : show the installation prefix (cf. autoconf)"
echo " --incdir : show the path to the APFEL header directory (for C++ interface)"
echo " --libdir : show the path to the APFEL library directory"
echo " --cppflags : get compiler flags for use with the C preprocessor stage of C++ compilation"
echo " --cxxflags : get compiler flags for use with the C preprocessor stage of C++ compilation"
echo " --ldflags : get compiler flags for use with the linker stage of any compilation"
echo
echo " --version : returns APFELgrid release version number"
fi
OUT=""
tmp=$( echo "$*" | egrep -- '--\<prefix\>')
test -n "$tmp" && OUT="$OUT @prefix@"
tmp=$( echo "$*" | egrep -- '--\<incdir\>')
test -n "$tmp" && OUT="$OUT @includedir@"
tmp=$( echo "$*" | egrep -- '--\<cppflags\>')
test -n "$tmp" && OUT="$OUT @SIMD_FLAGS@ -I@includedir@"
tmp=$( echo "$*" | egrep -- '--\<cxxflags\>')
test -n "$tmp" && OUT="$OUT @SIMD_FLAGS@ -I@includedir@"
tmp=$( echo "$*" | egrep -- '--\<libdir\>')
test -n "$tmp" && OUT="$OUT @libdir@"
tmp=$( echo "$*" | egrep -- '--\<ldflags\>')
test -n "$tmp" && OUT="$OUT -L@libdir@ -lAPFELgrid"
## Version
tmp=$( echo "$*" | egrep -- '--\<version\>')
test -n "$tmp" && OUT="$OUT @PACKAGE_VERSION@"
echo $OUT