Check for RSL in configure.ac
authorAndy Spencer <andy753421@gmail.com>
Wed, 9 Sep 2009 02:54:57 +0000 (02:54 +0000)
committerAndy Spencer <andy753421@gmail.com>
Wed, 9 Sep 2009 02:54:57 +0000 (02:54 +0000)
configure.ac
docs/api/Makefile.am
src/plugins/Makefile.am

index 58a1103..5197755 100644 (file)
@@ -16,10 +16,8 @@ PKG_CHECK_MODULES(GTK,  gtk+-2.0 >= 2.16 gtkglext-1.0)
 PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.26)
 
 # Define odd RSL install location
-#AC_SUBST(RSL_CFLAGS, "-I/usr/local/trmm/GVBOX/include/")
-#AC_SUBST(RSL_LIBS,   "-L/usr/local/trmm/GVBOX/lib/ -lrsl")
-AC_SUBST(RSL_CFLAGS, "")
-AC_SUBST(RSL_LIBS,   "-lrsl")
+AC_CHECK_LIB(rsl, RSL_wsr88d_to_radar, RLS_LIBS="-lrsl")
+AM_CONDITIONAL(HAVE_RSL, test "$RSL_LIBS" != "")
 
 # Output 
 AC_CONFIG_FILES([
@@ -33,3 +31,8 @@ AC_CONFIG_FILES([
        docs/api/Makefile
 ])
 AC_OUTPUT
+
+# Print status messages
+if test "$RSL_LIBS" = ""; then
+       echo " ** Warning, RSL not found, radar plugin disabled"
+fi
index 826840a..4c995bf 100644 (file)
@@ -1,8 +1,13 @@
-AM_CPPFLAGS= $(RSL_CFLAGS) $(SOUP_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS)
-GTKDOC_LIBS=$(RSL_LIBS) $(SOUP_LIBS) $(GLIB_LIBS) $(GTK_LIBS) \
+AM_CPPFLAGS=$(SOUP_CFLAGS) $(GLIB_CFLAGS) $(GTK_CFLAGS)
+GTKDOC_LIBS=$(SOUP_LIBS) $(GLIB_LIBS) $(GTK_LIBS) \
        $(top_srcdir)/src/aweather-aweather-*.o \
-       $(top_srcdir)/src/gis/libgis*.o \
-       $(top_srcdir)/src/plugins/*.o
+       $(top_srcdir)/src/gis/libgis*.o
+IGNORE_HFILES= 
+if HAVE_RSL
+GTKDOC_LIBS += $(RSL_LIBS) $(top_srcdir)/src/plugins/*.o
+else
+IGNORE_HFILES += radar.h
+endif
 DOC_MODULE=aweather
 DOC_SOURCE_DIR=$(top_srcdir)/src/
 DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
index a3520ee..52a7840 100644 (file)
@@ -4,13 +4,14 @@ AM_LDFLAGS  = -module -avoid-version
 
 plugindir = $(libdir)/gis
 
-plugin_LTLIBRARIES = \
-       radar.la
+plugin_LTLIBRARIES =
 
-radar_la_SOURCES   = radar.c   radar.h \
+if HAVE_RSL
+plugin_LTLIBRARIES += radar.la
+radar_la_SOURCES = radar.c   radar.h \
        marching.c marching.h \
        radar-colormap.c
-radar_la_CPPFLAGS = $(RSL_CFLAGS) $(AM_CPPFLAGS) 
-radar_la_LIBADD   = $(RSL_LIBS)
+radar_la_LIBADD  = $(RSL_LIBS)
+endif
 
 MAINTAINERCLEANFILES = Makefile.in