summaryrefslogtreecommitdiffhomepage
path: root/sofort/pkgconf.sh
blob: a3f8eb0fa459877e265b23297071c7d5be020e88 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/sh

# prefix, exec_prefix
if [ "$PKGCONF_PREFIX" = "$PKGCONF_EXEC_PREFIX" ]; then
	echo 'prefix='${PKGCONF_PREFIX}
	echo 'exec_prefix=${prefix}'
else
	echo 'prefix='${PKGCONF_PREFIX}
	echo 'exec_prefix='${PKGCONF_EXEC_PREFIX}
fi


# (relative) includedir
prefix=`dirname "$PKGCONF_INCLUDEDIR"`
base=`basename "$PKGCONF_INCLUDEDIR"`

if [ "$prefix/$base" = "$PKGCONF_PREFIX/$base" ]; then
	echo 'includedir=${prefix}/'${base}
else
	echo 'includedir='${PKGCONF_INCLUDEDIR}
fi

if [ "$prefix/$base" = "$PKGCONF_PREFIX/include" ]; then
	CFLAGS=
else
	CFLAGS='-I{includedir}'
fi


# (relative) libdir
prefix=`dirname "$PKGCONF_LIBDIR"`
base=`basename "$PKGCONF_LIBDIR"`

if [ "$prefix/$base" = "$PKGCONF_EXEC_PREFIX/$base" ]; then
	echo 'libdir=${prefix}/'${base}
else
	echo 'libdir='${PKGCONF_LIBDIR}
fi

if [ "$prefix/$base" = "$PKGCONF_EXEC_PREFIX/lib" ]; then
	LDFLAGS='-l'${PKGCONF_NAME}
elif [ "$prefix/$base" = "$PKGCONF_EXEC_PREFIX/lib64" ]; then
	LDFLAGS='-l'${PKGCONF_NAME}
else
	LDFLAGS='-L'${PKGCONF_LIBDIR} '-l'${PKGCONF_NAME}
fi


# name, description, url, version
echo
echo 'Name:        '${PKGCONF_NAME}
echo 'Description: '${PKGCONF_DESC}
echo 'URL:         '${PKGCONF_USRC}
echo 'Version:     '${PKGCONF_VERSION}


# repo (optional)
if ! [ -z "$PKGCONF_REPO" ]; then
	echo 'Repo:        '${PKGCONF_REPO}
fi


# patches (optional)
if ! [ -z "$PKGCONF_PSRC" ]; then
	echo 'Patches:      '${PKGCONF_PSRC}
fi


# disto (optional)
if ! [ -z "$PKGCONF_DURL" ]; then
	echo 'Distro:       '${PKGCONF_DURL}
fi


# Cflags
if [ -z "$PKGCONF_DEFS" ] && [ -z "$CFLAGS" ]; then
	echo 'Cflags:'
elif [ -z "$PKGCONF_DEFS" ]; then
	echo 'Cflags:      '${CFLAGS}
elif [ -z "$CFLAGS" ]; then
	echo 'Cflags:      '${PKGCONF_DEFS}
else
	echo 'Cflags:      '${PKGCONF_DEFS} ${CFLAGS}
fi


# Libs
if [ -z "$PKGCONF_LIBS" ]; then
	echo 'Libs:        '${LDFLAGS}
else
	echo 'Libs:        '${PKGCONF_LIBS} ${LDFLAGS}
fi