[commit] r2095 - use PLUGIN_FIND and PLUGIN_REQUIRE macros wherever possible; prefer PLUGIN_REQUIRE_PACKAGE when supported

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2095 - use PLUGIN_FIND and PLUGIN_REQUIRE macros wherever possible; prefer PLUGIN_REQUIRE_PACKAGE when supported

commits-3
 
Author: piumarta
Date: 2009-08-26 12:17:25 -0700 (Wed, 26 Aug 2009)
New Revision: 2095

Modified:
   trunk/platforms/unix/ChangeLog
   trunk/platforms/unix/plugins/DBusPlugin/config.cmake
   trunk/platforms/unix/plugins/GStreamerPlugin/config.cmake
   trunk/platforms/unix/plugins/OggPlugin/config.cmake
   trunk/platforms/unix/plugins/RomePlugin/config.cmake
   trunk/platforms/unix/plugins/SocketPlugin/config.cmake
   trunk/platforms/unix/plugins/SqueakFFIPrims/config.cmake
   trunk/platforms/unix/plugins/UUIDPlugin/config.cmake
   trunk/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c
   trunk/platforms/unix/plugins/UnixOSProcessPlugin/config.cmake
   trunk/platforms/unix/vm-display-fbdev/config.cmake
   trunk/platforms/unix/vm-sound-ALSA/config.cmake
   trunk/platforms/unix/vm-sound-NAS/config.cmake
   trunk/platforms/unix/vm-sound-OSS/config.cmake
Log:
use PLUGIN_FIND and PLUGIN_REQUIRE macros wherever possible; prefer PLUGIN_REQUIRE_PACKAGE when supported

Modified: trunk/platforms/unix/ChangeLog
===================================================================
--- trunk/platforms/unix/ChangeLog 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/ChangeLog 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,5 +1,18 @@
 2009-08-26    <[hidden email]>
 
+ * plugins/RomePlugin/config.cmake, plugins/UUIDPlugin/config.cmake,
+ plugins/SqueakFFIPrims/config.cmake, plugins/OggPlugin/config.cmake,
+ plugins/UnixOSProcessPlugin/config.cmake,
+ plugins/GStreamerPlugin/config.cmake, plugins/DBusPlugin/config.cmake,
+ plugins/SocketPlugin/config.cmake, vm-sound-ALSA/config.cmake,
+ vm-sound-NAS/config.cmake, vm-display-fbdev/config.cmake,
+ vm-sound-OSS/config.cmake: Use PLUGIN_FIND and PLUGIN_REQUIRE macros
+ wheverver possible.  Remove explicit manipulation of include and library
+ lists.
+
+ * plugins/UUIDPlugin/sqUnixUUID.c: Assume include path set in
+ config.cmake as required.
+
  * vm/config.cmake: Remove explicit test for /usr/pkg.
  * vm/build.cmake: Search vm_include_directories and
  vm_link_directories.  Link against vm_link_libraries.

Modified: trunk/platforms/unix/plugins/DBusPlugin/config.cmake
===================================================================
--- trunk/platforms/unix/plugins/DBusPlugin/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/plugins/DBusPlugin/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,5 +1 @@
-CHECK_INCLUDE_FILE (dbus/dbus.h HAVE_DBUS_DBUS_H)
-
-IF (NOT HAVE_DBUS_DBUS_H)
-    PLUGIN_DISABLE ()
-ENDIF (NOT HAVE_DBUS_DBUS_H)
+PLUGIN_REQUIRE_PACKAGE (DBUS1 dbus-1)

Modified: trunk/platforms/unix/plugins/GStreamerPlugin/config.cmake
===================================================================
--- trunk/platforms/unix/plugins/GStreamerPlugin/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/plugins/GStreamerPlugin/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,5 +1,3 @@
-CHECK_INCLUDE_FILE (gst/gst.h HAVE_GST_GST_H)
-
-IF (NOT HAVE_GST_GST_H)
-    PLUGIN_DISABLE ()
-ENDIF (NOT HAVE_GST_GST_H)
+PLUGIN_REQUIRE_PACKAGE (GLIB2 glib-2.0)
+PLUGIN_REQUIRE_PACKAGE (XML2 libxml-2.0)
+PLUGIN_REQUIRE_INCLUDE (GST_GST gst/gst.h /usr/include/gstreamer-0.10)

Modified: trunk/platforms/unix/plugins/OggPlugin/config.cmake
===================================================================
--- trunk/platforms/unix/plugins/OggPlugin/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/plugins/OggPlugin/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,11 +1,7 @@
-CHECK_INCLUDE_FILE (vorbis/codec.h HAVE_VORBIS_CODEC_H)
-CHECK_INCLUDE_FILE (vorbis/vorbisenc.h HAVE_VORBIS_VORBISENC_H)
-CHECK_INCLUDE_FILE (speex/speex.h HAVE_SPEEX_SPEEX_H)
+PLUGIN_REQUIRE_INCLUDE (VORBIS_CODEC     vorbis/codec.h)
+PLUGIN_REQUIRE_INCLUDE (VORBIS_VORBISENC vorbis/vorbisenc.h)
+PLUGIN_REQUIRE_INCLUDE (SPEEX_SPEEX      speex/speex.h)
 
-CHECK_LIBRARY_EXISTS (ogg ogg_sync_buffer "" HAVE_LIB_OGG)
-CHECK_LIBRARY_EXISTS (vorbis vorbis_synthesis_headerin "" HAVE_LIB_VORBIS)
-CHECK_LIBRARY_EXISTS (speex speex_packet_to_header "" HAVE_LIB_SPEEX)
-
-IF (NOT HAVE_VORBIS_CODEC_H OR NOT HAVE_VORBIS_VORBISENC_H OR NOT HAVE_SPEEX_SPEEX_H OR NOT HAVE_LIB_OGG OR NOT HAVE_LIB_VORBIS OR NOT HAVE_LIB_SPEEX)
-    PLUGIN_DISABLE ()
-ENDIF ()
+PLUGIN_REQUIRE_LIBRARY (OGG    ogg)
+PLUGIN_REQUIRE_LIBRARY (VORBIS vorbis)
+PLUGIN_REQUIRE_LIBRARY (SPEEX  speex)

Modified: trunk/platforms/unix/plugins/RomePlugin/config.cmake
===================================================================
--- trunk/platforms/unix/plugins/RomePlugin/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/plugins/RomePlugin/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,16 +1,4 @@
-IF (PKG_CONFIG_FOUND)
-    PKG_CHECK_MODULES (PANGOCAIRO pangocairo)
-    PKG_CHECK_MODULES (FREETYPE freetype2)
-    IF (PANGOCAIRO_FOUND AND FREETYPE_FOUND)
-        SET (CMAKE_REQUIRED_INCLUDES ${PANGOCAIRO_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS})
-        CHECK_INCLUDE_FILE (cairo-ft.h HAVE_CAIRO_FT_H)
-    ENDIF ()
-ENDIF ()
-
-IF (HAVE_CAIRO_FT_H)
-    PLUGIN_INCLUDE_DIRECTORIES (${PANGOCAIRO_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS} ${cross}/plugins/SurfacePlugin)
-    PLUGIN_LINK_DIRECTORIES    (${PANGOCAIRO_LIBRARY_DIRS} ${FREETYPE_LIBRARY_DIRS})
-    PLUGIN_LINK_LIBRARIES      (${PANGOCAIRO_LIBRARIES}    ${FREETYPE_LIBRARIES})
-ELSE ()
-    PLUGIN_DISABLE ()
-ENDIF ()
+PLUGIN_REQUIRE_PACKAGE (PANGOCAIRO pangocairo)
+PLUGIN_REQUIRE_PACKAGE (FREETYPE freetype2)
+PLUGIN_REQUIRE_INCLUDE (CAIRO_FT cairo-ft.h)
+PLUGIN_INCLUDE_DIRECTORIES (${cross}/plugins/SurfacePlugin)

Modified: trunk/platforms/unix/plugins/SocketPlugin/config.cmake
===================================================================
--- trunk/platforms/unix/plugins/SocketPlugin/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/plugins/SocketPlugin/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,11 +1,2 @@
-CHECK_LIBRARY_EXISTS (socket bind "" HAVE_LIBSOCKET)
-
-IF (HAVE_LIBSOCKET)
-  USE_LIBRARY (socket)
-ENDIF (HAVE_LIBSOCKET)
-
-CHECK_LIBRARY_EXISTS (nsl gethostbyaddr "" HAVE_LIBNSL)
-
-IF (HAVE_LIBNSL)
-  USE_LIBRARY (nsl)
-ENDIF (HAVE_LIBNSL)
+PLUGIN_FIND_LIBRARY(SOCKET socket)
+PLUGIN_FIND_LIBRARY(NSL nsl)

Modified: trunk/platforms/unix/plugins/SqueakFFIPrims/config.cmake
===================================================================
--- trunk/platforms/unix/plugins/SqueakFFIPrims/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/plugins/SqueakFFIPrims/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -25,22 +25,14 @@
     SET (cpu any)
     SET (abi libffi)
     PLUGIN_MESSAGE ("${cpu}-${abi}")
-    IF (PKG_CONFIG_FOUND)
-      PKG_CHECK_MODULES (LIBFFI libffi)
-      IF (LIBFFI_FOUND)
-       PLUGIN_INCLUDE_DIRECTORIES (${LIBFFI_INCLUDE_DIRS})
-       PLUGIN_LINK_DIRECTORIES    (${LIBFFI_LIBRARY_DIRS})
-       PLUGIN_LINK_LIBRARIES      (${LIBFFI_LIBRARIES})
- SET (HAVE_FFI_H 1)
-      ENDIF ()
-    ENDIF ()
-      IF (NOT LIBFFI_FOUND)
+    PLUGIN_FIND_PACKAGE (LIBFFI libffi)
+    IF (NOT LIBFFI_FOUND)
       CHECK_INCLUDE_FILE (ffi.h HAVE_FFI_H)
       CHECK_INCLUDE_FILE (ffi/ffi.h HAVE_FFI_FFI_H)
       IF (NOT HAVE_FFI_H AND NOT HAVE_FFI_FFI_H)
         PLUGIN_DISABLE ()
-     ELSE ()
-        PLUGIN_LINK_LIBRARIES (ffi)
+      ELSE ()
+        PLUGIN_REQUIRE_LIBRARY (ffi)
       ENDIF ()
     ENDIF ()
   ENDIF ()

Modified: trunk/platforms/unix/plugins/UUIDPlugin/config.cmake
===================================================================
--- trunk/platforms/unix/plugins/UUIDPlugin/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/plugins/UUIDPlugin/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,14 +1,2 @@
-CHECK_INCLUDE_FILE (uuid.h HAVE_UUID_H)
-CHECK_INCLUDE_FILE (uuid/uuid.h HAVE_UUID_UUID_H)
-
-IF (NOT HAVE_UUID_H AND NOT HAVE_UUID_UUID_H)
-  PLUGIN_DISABLE ()
-ELSE ()
-  CHECK_LIBRARY_EXISTS (uuid uuid_generate "" HAVE_LIBUUID)
-  IF (HAVE_LIBUUID)
-    PLUGIN_LINK_LIBRARIES (uuid)
-  ENDIF ()
-ENDIF ()
-
-CONFIG_DEFINE (HAVE_UUID_H)
-CONFIG_DEFINE (HAVE_UUID_UUID_H)
+PLUGIN_REQUIRE_INCLUDE(UUID uuid.h /usr/include/uuid)
+PLUGIN_REQUIRE_LIBRARY(UUID uuid)

Modified: trunk/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c
===================================================================
--- trunk/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,9 +1,5 @@
 #include "config.h"
-#if defined(HAVE_UUID_H)
-# include <uuid.h>
-#elif defined(HAVE_UUID_UUID_H)
-# include <uuid/uuid.h>
-#endif
+#include <uuid.h>
 #include "sq.h"
 
 int sqUUIDInit(void)

Modified: trunk/platforms/unix/plugins/UnixOSProcessPlugin/config.cmake
===================================================================
--- trunk/platforms/unix/plugins/UnixOSProcessPlugin/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/plugins/UnixOSProcessPlugin/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,11 +1,7 @@
+PLUGIN_REQUIRE_LIBRARY (PTHREAD pthread)
+PLUGIN_INCLUDE_DIRECTORIES (${cross}/plugins/FilePlugin ${cross}/plugins/SocketPlugin)
+PLUGIN_DEFINITIONS (-DSQAIO_H=\"sqaio.h\")
+
 CHECK_FUNCTION_EXISTS (unsetenv HAVE_UNSETENV)
-CHECK_LIBRARY_EXISTS (pthread pthread_kill "" HAVE_LIB_PTHREAD)
 
-IF (NOT HAVE_LIB_PTHREAD)
-    PLUGIN_DISABLE ()
-ELSE ()
-    PLUGIN_INCLUDE_DIRECTORIES (${cross}/plugins/FilePlugin ${cross}/plugins/SocketPlugin)
-    PLUGIN_DEFINITIONS (-DSQAIO_H=\"sqaio.h\")
-ENDIF ()
-
 CONFIG_DEFINE (HAVE_UNSETENV)

Modified: trunk/platforms/unix/vm-display-fbdev/config.cmake
===================================================================
--- trunk/platforms/unix/vm-display-fbdev/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/vm-display-fbdev/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,7 +1,2 @@
-CHECK_INCLUDE_FILE (linux/fb.h HAVE_LINUX_FB_H)
-
-IF (NOT HAVE_LINUX_FB_H)
-  PLUGIN_DISABLE ()
-ELSE ()
-  PLUGIN_SOURCES (${unix}/${plugin}/sqUnixFBDev.c)
-ENDIF ()
+PLUGIN_REQUIRE_INCLUDE (LINUX_FB linux/fb.h)
+PLUGIN_SOURCES (${unix}/${plugin}/sqUnixFBDev.c)

Modified: trunk/platforms/unix/vm-sound-ALSA/config.cmake
===================================================================
--- trunk/platforms/unix/vm-sound-ALSA/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/vm-sound-ALSA/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,4 +1,2 @@
-CHECK_INCLUDE_FILE (alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H)
-IF (NOT HAVE_ALSA_ASOUNDLIB_H)
-    PLUGIN_DISABLE()
-ENDIF ()
+PLUGIN_REQUIRE_INCLUDE (ALSA_SOUNDLIB alsa/asoundlib.h)
+PLUGIN_REQUIRE_LIBRARY (ASOUND asound)

Modified: trunk/platforms/unix/vm-sound-NAS/config.cmake
===================================================================
--- trunk/platforms/unix/vm-sound-NAS/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/vm-sound-NAS/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,4 +1,2 @@
-CHECK_INCLUDE_FILE (audio/audio.h HAVE_AUDIO_AUDIO_H)
-IF (NOT HAVE_AUDIO_AUDIO_H)
-    PLUGIN_DISABLE ()
-ENDIF ()
+PLUGIN_REQUIRE_INCLUDE (AUDIO_AUDIO_H audio/audio.h)
+PLUGIN_REQUIRE_LIBRARY (AUDIO audio)

Modified: trunk/platforms/unix/vm-sound-OSS/config.cmake
===================================================================
--- trunk/platforms/unix/vm-sound-OSS/config.cmake 2009-08-26 19:07:50 UTC (rev 2094)
+++ trunk/platforms/unix/vm-sound-OSS/config.cmake 2009-08-26 19:17:25 UTC (rev 2095)
@@ -1,5 +1,2 @@
-CHECK_INCLUDE_FILE (alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H)
-CHECK_LIBRARY_EXISTS (asound snd_pcm_open "" HAVE_SND_PCM_OPEN)
-IF (NOT HAVE_ALSA_ASOUNDLIB_H OR NOT HAVE_SND_PCM_OPEN)
-    PLUGIN_DISABLE ()
-ENDIF ()
+PLUGIN_REQUIRE_INCLUDE (ALSA_SOUNDLIB alsa/asoundlib.h)
+PLUGIN_REQUIRE_LIBRARY (ASOUND asound)