Skip to content

Commit

Permalink
fixed: Changing configure options with out a make clean wouldn't
Browse files Browse the repository at this point in the history
necessarily rebuild properly due to assigning macros on the commandline
instead of in a file.  Move all most HAS_* to system.h and define them
as per HAVE_* from configure/config.h.

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@24188 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
althekiller committed Nov 2, 2009
1 parent 520fd4c commit ac77e39
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 18 deletions.
16 changes: 5 additions & 11 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ AC_CHECK_LIB([jpeg], [main],, AC_MSG_ERROR($missing_library)) # check for
AC_CHECK_LIB([pthread], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([lzo2], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([z], [main],, AC_MSG_ERROR($missing_library))

PKG_CHECK_MODULES([MAD], [mad],
[INCLUDES+=" $MAD_CFLAGS"; LIBS+=" $MAD_LIBS"],
AC_MSG_ERROR($missing_library))
Expand All @@ -348,7 +347,8 @@ PKG_CHECK_MODULES([PNG], [libpng],
[INCLUDES+=" $PNG_CFLAGS"; LIBS+=" $PNG_LIBS"],
AC_MSG_ERROR($missing_library))
PKG_CHECK_MODULES([PCRE], [libpcre],
[INCLUDES+=" $PCRE_CFLAGS"; LIBS+=" $PCRE_LIBS"],
[INCLUDES+=" $PCRE_CFLAGS"; LIBS+=" $PCRE_LIBS"]; \
AC_DEFINE([HAVE_LIBPCRE],[1],["Define to 1 if libpcre is installed"]),
AC_MSG_ERROR($missing_library))
PKG_CHECK_MODULES([CDIO], [libcdio],
[INCLUDES+=" $CDIO_CFLAGS"; LIBS+=" $CDIO_LIBS"],
Expand Down Expand Up @@ -432,8 +432,7 @@ if test "$host_vendor" = "apple" ; then
AC_MSG_RESULT($pulse_disabled)
else
if test "$use_pulse" = "yes"; then
AC_CHECK_LIB([pulse], [main],
LIBS=" -lpulse $LIBS";INCLUDES="$INCLUDES -DHAS_PULSEAUDIO",
AC_CHECK_LIB([pulse], [main],,
use_pulse=no;AC_MSG_RESULT($pulse_not_found))
else
AC_MSG_RESULT($pulse_disabled)
Expand All @@ -459,13 +458,11 @@ if test "$host_vendor" = "apple" ; then
AC_MSG_RESULT($avahi_disabled)
else
if test "$use_avahi" = "yes"; then
AC_CHECK_LIB([avahi-common], [main],
LIBS=" -lavahi-common $LIBS";,
AC_CHECK_LIB([avahi-common], [main],,
use_avahi=no;AC_MSG_RESULT($avahi_not_found))
if test "$use_avahi" = "yes"; then
#either both libs or none
AC_CHECK_LIB([avahi-client], [main],
LIBS=" -lavahi-client $LIBS";INCLUDES="$INCLUDES -DHAS_AVAHI",
AC_CHECK_LIB([avahi-client], [main],,
use_avahi=no;AC_MSG_RESULT($avahi_not_found))
fi
else
Expand Down Expand Up @@ -797,7 +794,6 @@ fi

if test "$use_gl" = "yes"; then
final_message="$final_message\n OpenGL:\tYes"
SDL_DEFINES=""
else
final_message="$final_message\n OpenGL:\tNo (Very Slow)"
SDL_DEFINES="-DHAS_SDL_2D"
Expand All @@ -818,7 +814,6 @@ fi

if test "$use_xrandr" = "yes"; then
final_message="$final_message\n XRandR:\tYes"
SDL_DEFINES="$SDL_DEFINES -DHAS_XRANDR"
else
final_message="$final_message\n XRandR:\tNo"
fi
Expand All @@ -831,7 +826,6 @@ fi

if test "$use_pcre" = "yes"; then
final_message="$final_message\n PCRE Support:\tYes"
SDL_DEFINES="$SDL_DEFINES -DHAS_PCRE"
else
final_message="$final_message\n PCRE Support:\tNo"
fi
Expand Down
11 changes: 9 additions & 2 deletions guilib/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
*/

#if defined(_LINUX) || defined(__APPLE__)
#if defined(HAVE_CONFIG_H) && !defined(_WIN32)
#include "../config.h"
#endif

Expand Down Expand Up @@ -105,8 +105,9 @@
#ifndef HAS_SDL_OPENGL
#define HAS_SDL_OPENGL
#endif
#ifdef HAS_AVAHI
#if defined(HAVE_LIBAVAHI_COMMON) && defined(HAVE_LIBAVAHI_CLIENT)
#define HAS_ZEROCONF
#define HAS_AVAHI
#endif
#define HAS_LCD
#define HAS_HAL
Expand All @@ -118,6 +119,12 @@
#define HAS_SDL_AUDIO
#define HAS_LIRC
#define HAS_SDL_WIN_EVENTS
#ifdef HAVE_LIBPULSE
#define HAS_PULSEAUDIO
#endif
#ifdef HAVE_LIBXRANDR
#define HAS_XRANDR
#endif
#endif

/*****************
Expand Down
3 changes: 2 additions & 1 deletion xbmc/linux/XRandR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
*
*/

#include "XRandR.h"

#ifdef HAS_XRANDR

#include <string.h>
#include "system.h"
#include "PlatformInclude.h"
#include "XRandR.h"
#include "tinyXML/tinyxml.h"
#include "../xbmc/utils/log.h"

Expand Down
2 changes: 2 additions & 0 deletions xbmc/linux/XRandR.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*
*/

#include "system.h"

#ifdef HAS_XRANDR

#include "StdString.h"
Expand Down
5 changes: 2 additions & 3 deletions xbmc/linux/ZeroconfAvahi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
*
*/

#ifdef HAS_AVAHI

#include "PlatformDefs.h"

#include "ZeroconfAvahi.h"

#ifdef HAS_AVAHI

#include <string>
#include <iostream>
#include <sstream>
Expand Down
2 changes: 2 additions & 0 deletions xbmc/linux/ZeroconfAvahi.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
*/

#include "system.h"

#ifdef HAS_AVAHI

#include <memory>
Expand Down
4 changes: 3 additions & 1 deletion xbmc/linux/ZeroconfBrowserAvahi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
* http://www.gnu.org/copyleft/gpl.html
*
*/
#ifdef HAS_AVAHI

#include "ZeroconfBrowserAvahi.h"

#ifdef HAS_AVAHI

#include <utils/log.h>
#include <SingleLock.h>
#include <GUIWindowManager.h>
Expand Down
1 change: 1 addition & 0 deletions xbmc/linux/ZeroconfBrowserAvahi.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*
*/

#include "system.h"
#ifdef HAS_AVAHI

#include <memory>
Expand Down

0 comments on commit ac77e39

Please sign in to comment.