File: configure.ac

package info (click to toggle)
gnoemoe 2.2.0+dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,968 kB
  • ctags: 2,990
  • sloc: ansic: 23,956; sh: 8,882; ruby: 300; makefile: 174; xml: 86
file content (234 lines) | stat: -rw-r--r-- 6,726 bytes parent folder | download | duplicates (5)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)
AC_INIT(gnoemoe, 2.2.0, http://www.icecrew.nl/software/gnoemoe)
AC_CONFIG_SRCDIR(gnoemoe/gm-app.c)
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)

AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE

AC_ISC_POSIX
AC_STDC_HEADERS
AC_PROG_CC
AC_PROG_YACC
AM_PROG_LIBTOOL
AM_PROG_CC_STDC
AC_HEADER_STDC
AM_PROG_LIBTOOL

AC_PROG_INTLTOOL([0.31])
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")

AC_PROG_INSTALL
AC_PROG_MAKE_SET

# AC_PATH_PROG(GCONFTOOL, gconftool-2)
AM_GCONF_SOURCE_2

GETTEXT_PACKAGE=gnoemoe
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
ALL_LINGUAS="nl"
AM_GLIB_GNU_GETTEXT

AC_PROG_YACC

PKG_CHECK_MODULES(PACKAGE, [
	gtk+-2.0 >= 2.8.0
	gdk-pixbuf-2.0 
	libgnome-2.0 
	libglade-2.0 
	gtksourceview-1.0 
	gnome-vfs-2.0 
	libgnomeui-2.0 
	vte 
	libxml-2.0 
])

AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)

AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)

AC_ARG_ENABLE(parser, [  --disable-parser		disable use of the moo code parser in the editor],
	parseren=$enableval, parseren=yes)

if test "_$parseren" = "_yes"; then
  AC_DEFINE([HAVE_PARSER], 1, [MOO code parser is enabled])
  AM_CONDITIONAL(HAS_PARSER, true)
  parsermsg="enjoy parsing"
  
  dnl Check for perfect hash function generator
  AC_CHECK_PROG([GPERF],[gperf],[gperf])
else
  AM_CONDITIONAL(HAS_PARSER, false)
  parsermsg="(user disabled)"
fi

AC_ARG_ENABLE(ruby, [  --disable-ruby	disable use of the ruby scripting support],
	rubyen=$enableval, rubyen=yes)

#----------------------------------------------------------------
# Look for Ruby
#----------------------------------------------------------------

if test "_$rubyen" = "_yes"; then
  RUBYBIN=

  AC_ARG_WITH(ruby,[  --with-ruby=path        Set location of Ruby executable],[ RUBYBIN="$withval"], [RUBYBIN=])

  # First figure out what the name of Ruby is

  if test -z "$RUBYBIN"; then
  	AC_CHECK_PROGS(RUBY, ruby)
  else
  	RUBY="$RUBYBIN"
  fi

  AC_MSG_CHECKING(for Ruby header files)
  if test -n "$RUBY"; then
  	RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null`
  	if test "$RUBYDIR" != ""; then
  		dirs="$RUBYDIR"
  		RUBY_CFLAGS=none
  		for i in $dirs; do
  			if test -r $i/ruby.h; then
  				AC_MSG_RESULT($i)
  				RUBY_CFLAGS="-idirafter $i"
  				break;
  			fi
  		done
  		if test "$RUBY_CFLAGS" = none; then
  			AC_MSG_RESULT(could not locate ruby.h, disabling ruby support)
  			rubymsg="(no headers found, install ruby-dev)"
  			rubyen="no"
  		fi

  		# Find library and path for linking.
  		AC_MSG_CHECKING(for Ruby library)
  		RUBYLIB=""
  		rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["libdir"]]') 2>/dev/null`
  		rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["bindir"]]') 2>/dev/null`
  		dirs="$dirs $rb_libdir $rb_bindir"

          rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null`
          RUBY_LIBS=`($RUBY -rrbconfig -e '
              c = Config::CONFIG
              if c.has_key? "LIBRUBYARG_STATIC" # 1.8.x
                  if c[["LIBRUBY"]] == c[["LIBRUBY_A"]]
                      link = c[["LIBRUBYARG_STATIC"]]
                  else
                      link = c[["LIBRUBYARG_SHARED"]]
                  end
              else # 1.6.x
                  link = "-l" + c[["RUBY_INSTALL_NAME"]]
              end
              puts link') 2>/dev/null`

  		if test "$rb_libruby" != ""; then
  			for i in $dirs; do
  				if (test -r $i/$rb_libruby;) then
  					RUBYLIB="$i"
  					break;
  				fi
  			done
  		fi
  		if test "$RUBYLIB" = ""; then
  			AC_MSG_RESULT(not found... disabling ruby support)
  			rubymsg="(libs not found)"
  			rubyen="no"
  		else
  			AC_MSG_RESULT($RUBY_LIBS in $RUBYLIB)
  		fi
  	else
  		AC_MSG_RESULT(unable to determine ruby configuration, disabling ruby support)
  		rubymsg="(unable to determine configuration)"
  		rubyen="no"
  	fi
  else
  	AC_MSG_RESULT(not found.. disabling ruby support)
  	rubymsg="(no headers found, install ruby-dev)"
  	rubyen="no"
  fi
fi

if test "_$rubyen" == "_no"; then
  RUBY_CFLAGS=""
  RUBY_LIBS=""
  AM_CONDITIONAL(HAS_RUBY, false)
else
  rubymsg="enjoy scripting :)"
  AC_DEFINE([HAVE_RUBY], 1, [Ruby scripting is enabled])
  AM_CONDITIONAL(HAS_RUBY, true)
fi

AC_SUBST(RUBY_CFLAGS)
AC_SUBST(RUBY_LIBS)

# Look for libnotify
LIBNOTIFY_REQUIRED=0.3.2
AC_ARG_ENABLE(libnotify, AC_HELP_STRING([--disable-libnotify],
		[Disable libnotify support]),,
		enable_libnotify=auto)
if test "x$enable_libnotify" != "xno"; then
	PKG_CHECK_MODULES(NOTIFY, libnotify >= $LIBNOTIFY_REQUIRED,
			have_libnotify=yes,
			have_libnotify=no)
	if test "x$have_libnotify" = "xno" -a "x$enable_libnotify" = "xyes"; then
		AC_MSG_ERROR([libnotify support explicitly requested, but libnotify couldn't be found])
	fi
	if test "x$have_libnotify" = "xyes"; then
		enable_libnotify=yes
	fi
fi

AM_CONDITIONAL(USE_NOTIFY, test x"$enable_libnotify" = xyes)

if test x$enable_libnotify = xyes ; then
	# Find out the version of LIBNOTIFY we're using
	libnotify_version=`pkg-config --modversion libnotify`
	LIBNOTIFY_VERSION_MAJOR=`echo $libnotify_version | awk -F. '{print $1}'`
	LIBNOTIFY_VERSION_MINOR=`echo $libnotify_version | awk -F. '{print $2}'`
	LIBNOTIFY_VERSION_MICRO=`echo $libnotify_version | awk -F. '{print $3}'`
    if test "z$LIBNOTIFY_VERSION_MAJOR" = "z"; then
        LIBNOTIFY_VERSION_MAJOR="0"
    fi
    if test "z$LIBNOTIFY_VERSION_MINOR" = "z"; then
        LIBNOTIFY_VERSION_MINOR="0"
    fi
    if test "z$LIBNOTIFY_VERSION_MICRO" = "z"; then
        LIBNOTIFY_VERSION_MICRO="0"
    fi
    echo "Your libnotify version is $LIBNOTIFY_VERSION_MAJOR,$LIBNOTIFY_VERSION_MINOR,$LIBNOTIFY_VERSION_MICRO."
    NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MAJOR=$LIBNOTIFY_VERSION_MAJOR"
    NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MINOR=$LIBNOTIFY_VERSION_MINOR"
    NOTIFY_CFLAGS="$NOTIFY_CFLAGS -DLIBNOTIFY_VERSION_MICRO=$LIBNOTIFY_VERSION_MICRO"

    AC_DEFINE(HAVE_NOTIFY, 1, [Define if libnotify support is enabled])
    AC_SUBST(NOTIFY_CFLAGS)
    AC_SUBST(NOTIFY_LIBS)
fi

AC_OUTPUT([
Makefile
pixmaps/Makefile
pixmaps/userlist/Makefile
pixmaps/ice-userlist/Makefile
pixmaps/tray/Makefile
gnoemoe/Makefile
gnoemoe/parser/Makefile
po/Makefile.in
scripts/Makefile
ui/Makefile
data/Makefile
])

echo
echo Building with ruby ............. : $rubyen $rubymsg
echo Building with parser ........... : $parseren $parsermsg
echo Building with libnotify ........ : $have_libnotify $libnotify_version
echo Install prefix ................. : $prefix
echo Install share .................. : $datadir