18 printf "%s\n" "$1" >> config.mak
22 add_config
"CFLAGS += $1"
26 add_config
"LDFLAGS += $1"
29 add_pkgconf_cflags
() {
30 flags
=$
(pkg-config
--cflags "$1")
34 add_pkgconf_ldflags
() {
35 flags
=$
(pkg-config
--libs "$1")
40 add_pkgconf_cflags
"$1"
41 add_pkgconf_ldflags
"$1"
47 result
=$
(which "$program" 2>/dev
/null
)
48 if [ "$needed" = "1" ] && [ -z "$result" ] ; then
49 echo "error: needed program $program not found"
52 printf "%s\n" "$program"
56 echo "supported arguments"
57 echo "--prefix=/path default: $prefix"
58 echo "--exec_prefix=/path default: $prefix/bin"
59 echo "--bindir=/path default: $prefix/bin"
60 echo "--libdir=/path default: $prefix/lib"
61 echo "--includedir=/path default: $prefix/include"
62 echo "--sysconfdir=/path default: $prefix/etc"
63 echo "--help : show this text"
70 #alternatives echo "$arg" | cut -d= -f2-
71 # or echo "$arg" | sed 's/[^=]*=//'
76 --prefix=*) prefix
=`spliteq $1`;;
77 --exec_prefix=*) exec_prefix
=`spliteq $1`;;
78 --bindir=*) bindir
=`spliteq $1`;;
79 --libdir=*) libdir
=`spliteq $1`;;
80 --includedir=*) includedir
=`spliteq $1`;;
81 --sysconfdir=*) sysconfdir
=`spliteq $1`;;
88 -*) parsearg
"$1"; shift;;
93 [ -z "$exec_prefix" ] && exec_prefix
=$prefix
94 [ -z "$libdir" ] && libdir
=$prefix/lib
95 [ -z "$includedir" ] && includedir
=$prefix/include
96 [ -z "$sysconfdir" ] && sysconfdir
=$prefix/etc
97 [ -z "$bindir" ] && bindir
=$exec_prefix/bin
102 add_config
"prefix = $prefix"
103 add_config
"exec_prefix = $exec_prefix"
104 add_config
"bindir = $bindir"
105 add_config
"libdir = $libdir"
106 add_config
"includedir = $includedir"
107 add_config
"sysconfdir = $sysconfdir"
109 add_config
"CC ?= $CC"
110 [ -z "$CPPFLAGS" ] || add_config
"CPPFLAGS ?= $CPPFLAGS"
111 [ -z "$CFLAGS" ] || add_config
"CFLAGS ?= $CFLAGS"
113 add_cflags
"-DXCHATLIBDIR=\\\"$libdir/xchat\\\""
114 add_cflags
"-DXCHATSHAREDIR=\\\"$prefix/share/xchat\\\""
115 add_cflags
"-DUSE_OPENSSL"
117 for lib
in $libs ; do add_lib
"$lib" ; done
119 prog1
=$
(check_program
"gdk-pixbuf-csource" 1)
120 add_config
"PIXMAPCONVERT = $prog1"
122 echo done, now run
make \
&\
& make install