summaryrefslogtreecommitdiff
blob: 5481c6a75475364bacb4d8594ece60234f289482 (plain)
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
50
51
52
53
54
55
#!/bin/bash
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# based on gcc-config by Martin Schlemmer <azarah@gentoo.org
# Author:  Heinrich Wendel <lanius@gentoo.org>

# Stripped down minimal version for backwards compatibility only.
# We now just provide the info that other applications might use
# to compile and link against openmotif - Jakub Moc <jakub@gentoo.org>

usage() {
cat << "USAGE_END"
Usage: motif-config [option]

Options:
  -L, --get-lib-path         Print path where openmotif libraries are located.
  -I, --get-inc-path         Print path where openmotif includes are located.
      --libs                 Print link flags for openmotif
      --cflags               Print compilation flags for openmotif
USAGE_END
    exit $1
}

get_lib_path() {
	echo "/usr/@@LIBDIR@@/"
	exit 0
}

get_inc_path() {
	echo "/usr/include/"
	exit 0
}

get_libs() {
	echo "-L/usr/@@LIBDIR@@/"
	exit 0
}

get_cflags() {
	echo "-I/usr/include/"
	exit 0
}

[[ $# -lt 1 ]] && usage 1
[[ $# -gt 2 ]] && usage 1

case "$1" in
	-L|--get-lib-path) get_lib_path ;;
	-I|--get-inc-path) get_inc_path ;;
	   --libs)         get_libs ;;
	   --cflags)       get_cflags ;;
	-h|--help)         usage 0 ;;
	-v|--version)      echo "motif-config-2.3"; exit 0 ;;
	*)                 usage 1 ;;
esac