comparison dwindows-config1.in @ 1611:2675e0edcc1d

First attempt at fixing dwindows-config --version after the build system versioning changes a couple versions ago... might require further tweaks.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 24 Mar 2012 14:57:20 +0000
parents
children c677d728e143
comparison
equal deleted inserted replaced
1610:48a61abcd5bb 1611:2675e0edcc1d
1 #!/bin/sh
2
3 dw_libs="@LIBS@"
4 dw_cflags="@CFLAGS@ -D@DW_DEFINE@"
5
6 prefix=@prefix@
7 exec_prefix=@exec_prefix@
8 exec_prefix_set=no
9
10 usage()
11 {
12 cat <<EOF
13 Usage: dwindows-config [OPTIONS]
14 Options:
15 [--prefix[=DIR]]
16 [--exec-prefix[=DIR]]
17 [--version]
18 [--libs]
19 [--cflags]
20 EOF
21 exit $1
22 }
23
24 if test $# -eq 0; then
25 usage 1 1>&2
26 fi
27
28 while test $# -gt 0; do
29 case "$1" in
30 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
31 *) optarg= ;;
32 esac
33
34 case $1 in
35 --prefix=*)
36 prefix=$optarg
37 if test $exec_prefix_set = no ; then
38 exec_prefix=$optarg
39 fi
40 ;;
41 --prefix)
42 echo_prefix=yes
43 ;;
44 --exec-prefix=*)
45 exec_prefix=$optarg
46 exec_prefix_set=yes
47 ;;
48 --version)
49 echo @DW_MAJOR_VERSION@.@DW_MINOR_VERSION@.@DW_SUB_VERSION@
50 ;;
51 --cflags)
52 echo_cflags=yes
53 ;;
54 --libs)
55 echo_libs=yes
56 ;;
57 *)
58 usage 1 1>&2
59 ;;
60 esac
61 shift
62 done
63
64 if test "$echo_prefix" = "yes"; then
65 echo $prefix
66 fi
67
68 if test "$echo_exec_prefix" = "yes"; then
69 echo $exec_prefix
70 fi
71
72 if test "$echo_cflags" = "yes"; then
73 echo -I${prefix}/include $dw_cflags
74 fi
75
76 if test "$echo_libs" = "yes"; then
77 echo -L${prefix}/lib -ldwindows $dw_libs
78 fi
79