aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-14 21:00:17 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-14 21:00:17 +0000
commitfaca3789385e2d0235450684902c747e03120489 (patch)
tree3f7641a12b95637162baab44bd0c8d1550c478a7
parent6ed0ce54552660e1b51df060826e16fc522d5f62 (diff)
downloadgnunet-gtk-faca3789385e2d0235450684902c747e03120489.tar.gz
gnunet-gtk-faca3789385e2d0235450684902c747e03120489.zip
LRN: compile against libgladeui-1 or 2
-rw-r--r--configure.ac83
-rw-r--r--contrib/Makefile.in1
-rw-r--r--gnunet_gtk_config.h.in14
-rw-r--r--src/Makefile.am4
4 files changed, 69 insertions, 33 deletions
diff --git a/configure.ac b/configure.ac
index 5c9ad937..16ad763f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,6 @@ then
56 CFLAGS="-fno-strict-aliasing $CFLAGS" 56 CFLAGS="-fno-strict-aliasing $CFLAGS"
57fi 57fi
58 58
59
60# Check system type 59# Check system type
61case "$host_os" in 60case "$host_os" in
62*darwin* | *rhapsody* | *macosx*) 61*darwin* | *rhapsody* | *macosx*)
@@ -161,42 +160,76 @@ AC_CHECK_HEADERS([glib.h gmodule.h gtk/gtk.h],,AC_MSG_ERROR([gnunet-gtk requires
161 160
162# test for Glade 161# test for Glade
163glade=0 162glade=0
163lookin=${prefix}
164GLADE_CPPFLAGS=""
165GLADE_LDFLAGS=""
166GLADE_CFLAGS=""
164AC_MSG_CHECKING(for Glade core) 167AC_MSG_CHECKING(for Glade core)
165AC_ARG_WITH(glade, 168AC_ARG_WITH(glade,
166 [ --with-glade=PFX Base of Glade installation], 169 [ --with-glade=PFX Base of Glade installation (found with pkg-config if omitted)],
167 [AC_MSG_RESULT([$with_glade]) 170 [AC_MSG_RESULT([$with_glade])
168 case $with_glade in 171 case $with_glade in
169 no) 172 no)
173 lookin=""
170 ;; 174 ;;
171 yes) 175 yes)
172 LDFLAGS="-L/usr/lib $LDFLAGS" 176 lookin="${prefix}"
173 CPPFLAGS="-I/usr/include/libgladeui-2.0 $CPPFLAGS"
174 AC_CHECK_HEADERS(gladeui/glade.h,
175 AC_CHECK_LIB([gladeui-2], [glade_xml_node_new],
176 glade=1))
177 ;; 177 ;;
178 *) 178 *)
179 LDFLAGS="-L$with_glade/lib $LDFLAGS" 179 lookin="$with_glade"
180 CPPFLAGS="-I$with_glade/include/libgladeui-2.0 $CPPFLAGS"
181 AC_CHECK_HEADERS(gladeui/glade.h,
182 AC_CHECK_LIB([gladeui-2], [glade_xml_node_new],
183 EXT_LIB_PATH="-L$with_glade/lib $EXT_LIB_PATH"
184 glade=1))
185 ;; 180 ;;
186 esac 181 esac
187 ], 182 ],
188 [AC_MSG_RESULT([--with-glade not specified]) 183 [
189 LDFLAGS="-L/usr/glade/lib $LDFLAGS" 184 AC_MSG_RESULT([--with-glade not specified])
190 CPPFLAGS="-I/usr/include/libgladeui-2.0 $CPPFLAGS" 185 PKG_CHECK_MODULES([GLADE], [gladeui-1.0 >= 3.8.0], glade=1,
186 [
187 PKG_CHECK_MODULES([GLADE], [gladeui-2.0 >= 3.10.0], glade=2)
188 ]
189 )
190 ]
191)
192
193if test "x$glade" == "x0" -a ! "x$lookin" == "x"
194then
195 backup_LIBS="$LIBS"
196 backup_CFLAGS="$CFLAGS"
197 GLADE_LIBS="-L${lookin}/lib"
198 GLADE_CFLAGS="-I${lookin}/include/libgladeui-1.0"
199 LIBS="$GLADE_LIBS $backup_LIBS"
200 CFLAGS="$GLADE_CFLAGS $backup_CFLAGS"
201 AC_CHECK_HEADERS(gladeui/glade.h,
202 AC_CHECK_LIB([gladeui-1], [glade_xml_node_new],
203 [glade=1]
204 )
205 )
206 if test "x$glade" == "x0"
207 then
208 GLADE_LIBS="-L${lookin}/lib"
209 GLADE_CFLAGS="-I${lookin}/include/libgladeui-2.0"
210 LIBS="$GLADE_LIBS $backup_LIBS"
211 CFLAGS="$GLADE_CFLAGS $backup_CFLAGS"
191 AC_CHECK_HEADERS(gladeui/glade.h, 212 AC_CHECK_HEADERS(gladeui/glade.h,
192 AC_CHECK_LIB([gladeui-2], [glade_xml_node_new], 213 AC_CHECK_LIB([gladeui-2], [glade_xml_node_new],
193 glade=1))]) 214 glade=2)
215 )
216 fi
217 if test ! "x$glade" == "x0"
218 then
219 EXT_LIB_PATH="-L${lookin}/lib $EXT_LIB_PATH"
220 fi
221 LIBS="$backup_LIBS"
222 CFLAGS="$backup_CFLAGS"
223fi
194 224
195if test "$glade" != 1 225if test "x$glade" == "x0"
196then 226then
197 AC_MSG_ERROR([gnunet-gtk requires Glade3 (library and headers)]) 227 AC_MSG_ERROR([gnunet-gtk requires Glade3 (library and headers)])
198fi 228fi
199 229
230AC_SUBST(GLADE_CFLAGS)
231AC_SUBST(GLADE_LIBS)
232
200# test for GNUnet core 233# test for GNUnet core
201gnunet=0 234gnunet=0
202AC_MSG_CHECKING(for GNUnet core) 235AC_MSG_CHECKING(for GNUnet core)
@@ -247,7 +280,7 @@ if test "$gnunet" != 1
247then 280then
248 AC_MSG_ERROR([gnunet-gtk requires GNUnet]) 281 AC_MSG_ERROR([gnunet-gtk requires GNUnet])
249fi 282fi
250AC_CHECK_HEADERS([gnunet/gnunet_fs_service.h gnunet/gnunet_statistics_service.h gnunet/gnunet_core_service.h],, 283AC_CHECK_HEADERS([gnunet/gnunet_fs_service.h gnunet/gnunet_statistics_service.h gnunet/gnunet_core_service.h], [],
251 AC_MSG_ERROR([compiling gnunet-gtk requires GNUnet core headers])) 284 AC_MSG_ERROR([compiling gnunet-gtk requires GNUnet core headers]))
252 285
253SAVELIBS=$LIBS 286SAVELIBS=$LIBS
@@ -259,8 +292,12 @@ AC_CHECK_LIB(gnunetstatistics,GNUNET_STATISTICS_get,,
259 AC_MSG_ERROR([gnunet-gtk requires STATISTICS])) 292 AC_MSG_ERROR([gnunet-gtk requires STATISTICS]))
260AC_CHECK_LIB(gnunetcore,GNUNET_CORE_connect,, 293AC_CHECK_LIB(gnunetcore,GNUNET_CORE_connect,,
261 AC_MSG_ERROR([gnunet-gtk requires CORE])) 294 AC_MSG_ERROR([gnunet-gtk requires CORE]))
262AC_CHECK_LIB(gladeui-2,glade_xml_node_new,, 295AC_CHECK_LIB(gladeui-1,glade_xml_node_new, [],
263 AC_MSG_ERROR([gnunet-gtk requires glade3])) 296 [
297 AC_CHECK_LIB(gladeui-2,glade_xml_node_new,,
298 AC_MSG_ERROR([gnunet-gtk requires glade3]))
299 ]
300 )
264LIBS=$SAVELIBS 301LIBS=$SAVELIBS
265 302
266AC_SUBST(GNUNETGTK_CFLAGS) 303AC_SUBST(GNUNETGTK_CFLAGS)
diff --git a/contrib/Makefile.in b/contrib/Makefile.in
index 134921a5..ee9970f6 100644
--- a/contrib/Makefile.in
+++ b/contrib/Makefile.in
@@ -157,7 +157,6 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
157INSTALL_SCRIPT = @INSTALL_SCRIPT@ 157INSTALL_SCRIPT = @INSTALL_SCRIPT@
158INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ 158INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
159INTLLIBS = @INTLLIBS@ 159INTLLIBS = @INTLLIBS@
160INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
161LD = @LD@ 160LD = @LD@
162LDFLAGS = @LDFLAGS@ 161LDFLAGS = @LDFLAGS@
163LIBICONV = @LIBICONV@ 162LIBICONV = @LIBICONV@
diff --git a/gnunet_gtk_config.h.in b/gnunet_gtk_config.h.in
index 1e1447e0..cbd21e92 100644
--- a/gnunet_gtk_config.h.in
+++ b/gnunet_gtk_config.h.in
@@ -15,14 +15,6 @@
15/* Define to 1 if you have the <argz.h> header file. */ 15/* Define to 1 if you have the <argz.h> header file. */
16#undef HAVE_ARGZ_H 16#undef HAVE_ARGZ_H
17 17
18/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
19 CoreFoundation framework. */
20#undef HAVE_CFLOCALECOPYCURRENT
21
22/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
23 the CoreFoundation framework. */
24#undef HAVE_CFPREFERENCESCOPYAPPVALUE
25
26/* Define if the GNU dcgettext() function is already present or preinstalled. 18/* Define if the GNU dcgettext() function is already present or preinstalled.
27 */ 19 */
28#undef HAVE_DCGETTEXT 20#undef HAVE_DCGETTEXT
@@ -224,3 +216,9 @@
224 216
225/* This is a Windows system */ 217/* This is a Windows system */
226#undef _WIN32 218#undef _WIN32
219
220/* Define to `int' if <sys/types.h> doesn't define. */
221#undef gid_t
222
223/* Define to `int' if <sys/types.h> doesn't define. */
224#undef uid_t
diff --git a/src/Makefile.am b/src/Makefile.am
index 480432f8..5d04f38d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,7 +3,8 @@ SUBDIRS = .
3INCLUDES = \ 3INCLUDES = \
4 -I$(top_srcdir)/ \ 4 -I$(top_srcdir)/ \
5 @GTK_CFLAGS@ \ 5 @GTK_CFLAGS@ \
6 @GNUNETGTK_CFLAGS@ 6 @GNUNETGTK_CFLAGS@ \
7 @GLADE_CFLAGS@
7 8
8bin_PROGRAMS = gnunet-gtk 9bin_PROGRAMS = gnunet-gtk
9 10
@@ -26,6 +27,7 @@ gnunet_gtk_SOURCES = \
26 peerinfo.c peerinfo.h 27 peerinfo.c peerinfo.h
27gnunet_gtk_LDADD = \ 28gnunet_gtk_LDADD = \
28 @GTK_LIBS@ \ 29 @GTK_LIBS@ \
30 @GLADE_LIBS@ \
29 -lextractor \ 31 -lextractor \
30 -lgnunetutil \ 32 -lgnunetutil \
31 -lgnunetpeerinfo \ 33 -lgnunetpeerinfo \