# HG changeset patch # User Michiel Broek # Date 1446932068 -3600 # Node ID e3f8a51b566af178e502f164d4ae47d0ef49fd48 # Parent cdf68044adafd7429848ef258536b78e2faa686f Fixed compiling on systems without SDL libraries, and they don't need tha brewpanel program. diff -r cdf68044adaf -r e3f8a51b566a brewco/brewco.h --- a/brewco/brewco.h Sat Nov 07 22:04:17 2015 +0100 +++ b/brewco/brewco.h Sat Nov 07 22:34:28 2015 +0100 @@ -22,6 +22,7 @@ #include #include #include +#include #ifndef HAVE_WIRINGPI_H #include diff -r cdf68044adaf -r e3f8a51b566a brewpanel/brewpanel.c --- a/brewpanel/brewpanel.c Sat Nov 07 22:04:17 2015 +0100 +++ b/brewpanel/brewpanel.c Sat Nov 07 22:34:28 2015 +0100 @@ -24,6 +24,7 @@ #include "sdlgui.h" #include "dlgBrew.h" +#ifdef HAVE_SDL_SDL_H int DebugPanel = FALSE; /* Logfile debugging */ int debug = FALSE; /* Console debugging */ @@ -161,4 +162,13 @@ return 0; } +#else +int main(int argc, char *argv[]) +{ + fprintf(stderr, "brewpanel not compiled because SDL is missing.\n"); + return 1; +} + +#endif + diff -r cdf68044adaf -r e3f8a51b566a brewpanel/brewpanel.h --- a/brewpanel/brewpanel.h Sat Nov 07 22:04:17 2015 +0100 +++ b/brewpanel/brewpanel.h Sat Nov 07 22:34:28 2015 +0100 @@ -23,8 +23,9 @@ #include #include +#ifdef HAVE_SDL_SDL_H #include #include - +#endif #endif diff -r cdf68044adaf -r e3f8a51b566a brewpanel/dlgBrew.c --- a/brewpanel/dlgBrew.c Sat Nov 07 22:04:17 2015 +0100 +++ b/brewpanel/dlgBrew.c Sat Nov 07 22:34:28 2015 +0100 @@ -27,6 +27,8 @@ #include "dlgBrew.h" #include "sdlgui.h" +#ifdef HAVE_SDL_SDL_H + extern SDL_Surface *PAN_surface; extern int my_shutdown; @@ -102,3 +104,4 @@ return TRUE; } +#endif diff -r cdf68044adaf -r e3f8a51b566a brewpanel/dlgBrew.h --- a/brewpanel/dlgBrew.h Sat Nov 07 22:04:17 2015 +0100 +++ b/brewpanel/dlgBrew.h Sat Nov 07 22:34:28 2015 +0100 @@ -1,7 +1,9 @@ #ifndef _DLGBREW_H #define _DLGBREW_H +#ifdef HAVE_SDL_SDL_H int Dialog_BrewDlg(void); #endif +#endif diff -r cdf68044adaf -r e3f8a51b566a brewpanel/sdlgui.c --- a/brewpanel/sdlgui.c Sat Nov 07 22:04:17 2015 +0100 +++ b/brewpanel/sdlgui.c Sat Nov 07 22:34:28 2015 +0100 @@ -25,6 +25,9 @@ #include "brewpanel.h" #include "sdlgui.h" + +#ifdef HAVE_SDL_SDL_H + #include "lcdfont10x16.h" @@ -695,4 +698,5 @@ } +#endif diff -r cdf68044adaf -r e3f8a51b566a brewpanel/sdlgui.h --- a/brewpanel/sdlgui.h Sat Nov 07 22:04:17 2015 +0100 +++ b/brewpanel/sdlgui.h Sat Nov 07 22:34:28 2015 +0100 @@ -1,7 +1,7 @@ #ifndef _SDLGUI_H #define _SDLGUI_H -//#include +#ifdef HAVE_SDL_SDL_H enum { @@ -54,3 +54,5 @@ void SDLGui_LCDwrite(SGOBJ *dlg, int x, int y, Uint8 c, int lcdindex); #endif + +#endif diff -r cdf68044adaf -r e3f8a51b566a configure --- a/configure Sat Nov 07 22:04:17 2015 +0100 +++ b/configure Sat Nov 07 22:34:28 2015 +0100 @@ -3676,27 +3676,26 @@ fi # Check for SDL +SDL_CFLAGS="" +SDL_LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking SDL library" >&5 $as_echo_n "checking SDL library... " >&6; } pkg-config --exists sdl if test "$?" = "0"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -else - as_fn_error $? "no" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sdl library v1.2.0 or newer" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking sdl library v1.2.0 or newer" >&5 $as_echo_n "checking sdl library v1.2.0 or newer... " >&6; } -pkg-config --atleast-version=1.2.0 sdl -if test "$?" = "0"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 + pkg-config --atleast-version=1.2.0 sdl + if test "$?" = "0"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } -else - as_fn_error $? "not found" "$LINENO" 5 -fi -SDL_CFLAGS="$(pkg-config --cflags sdl)" -SDL_LIBS="$(pkg-config --libs sdl)" -for ac_header in SDL/SDL.h + else + as_fn_error $? "not found" "$LINENO" 5 + fi + SDL_CFLAGS="$(pkg-config --cflags sdl)" + SDL_LIBS="$(pkg-config --libs sdl)" + for ac_header in SDL/SDL.h do : ac_fn_c_check_header_mongrel "$LINENO" "SDL/SDL.h" "ac_cv_header_SDL_SDL_h" "$ac_includes_default" if test "x$ac_cv_header_SDL_SDL_h" = xyes; then : @@ -3708,6 +3707,10 @@ done +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi # Check for SDL_ttf { $as_echo "$as_me:${as_lineno-$LINENO}: checking SDL_ttf library" >&5 @@ -3716,22 +3719,22 @@ if test "$?" = "0"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } -else - as_fn_error $? "no" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sdl library v2.0.0 or newer" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking sdl library v2.0.0 or newer" >&5 $as_echo_n "checking sdl library v2.0.0 or newer... " >&6; } -pkg-config --atleast-version=2.0.0 SDL_ttf -if test "$?" = "0"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 + pkg-config --atleast-version=2.0.0 SDL_ttf + if test "$?" = "0"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } + else + as_fn_error $? "not found" "$LINENO" 5 + fi + # Override flags + SDL_CFLAGS="$(pkg-config --cflags SDL_ttf)" + SDL_LIBS="$(pkg-config --libs SDL_ttf)" else - as_fn_error $? "not found" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -# Override flags -SDL_CFLAGS="$(pkg-config --cflags SDL_ttf)" -SDL_LIBS="$(pkg-config --libs SDL_ttf)" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } diff -r cdf68044adaf -r e3f8a51b566a configure.ac --- a/configure.ac Sat Nov 07 22:04:17 2015 +0100 +++ b/configure.ac Sat Nov 07 22:34:28 2015 +0100 @@ -82,43 +82,44 @@ fi # Check for SDL +SDL_CFLAGS="" +SDL_LIBS="" AC_MSG_CHECKING(SDL library) pkg-config --exists sdl if test "$?" = "0"; then AC_MSG_RESULT(yes) + AC_MSG_CHECKING(sdl library v1.2.0 or newer) + pkg-config --atleast-version=1.2.0 sdl + if test "$?" = "0"; then + AC_MSG_RESULT(found) + else + AC_MSG_ERROR(not found) + fi + SDL_CFLAGS="$(pkg-config --cflags sdl)" + SDL_LIBS="$(pkg-config --libs sdl)" + AC_CHECK_HEADERS(SDL/SDL.h) else - AC_MSG_ERROR(no) + AC_MSG_RESULT(no) fi -AC_MSG_CHECKING(sdl library v1.2.0 or newer) -pkg-config --atleast-version=1.2.0 sdl -if test "$?" = "0"; then - AC_MSG_RESULT(found) -else - AC_MSG_ERROR(not found) -fi -SDL_CFLAGS="$(pkg-config --cflags sdl)" -SDL_LIBS="$(pkg-config --libs sdl)" -AC_CHECK_HEADERS(SDL/SDL.h) # Check for SDL_ttf AC_MSG_CHECKING(SDL_ttf library) pkg-config --exists SDL_ttf if test "$?" = "0"; then AC_MSG_RESULT(yes) + AC_MSG_CHECKING(sdl library v2.0.0 or newer) + pkg-config --atleast-version=2.0.0 SDL_ttf + if test "$?" = "0"; then + AC_MSG_RESULT(found) + else + AC_MSG_ERROR(not found) + fi + # Override flags + SDL_CFLAGS="$(pkg-config --cflags SDL_ttf)" + SDL_LIBS="$(pkg-config --libs SDL_ttf)" else - AC_MSG_ERROR(no) + AC_MSG_RESULT(no) fi -AC_MSG_CHECKING(sdl library v2.0.0 or newer) -pkg-config --atleast-version=2.0.0 SDL_ttf -if test "$?" = "0"; then - AC_MSG_RESULT(found) -else - AC_MSG_ERROR(not found) -fi -# Override flags -SDL_CFLAGS="$(pkg-config --cflags SDL_ttf)" -SDL_LIBS="$(pkg-config --libs SDL_ttf)" - dnl Checks for header files. AC_HEADER_STDC