Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Commit

Permalink
Removed redundant library checks. Changed SDL_image check to specific…
Browse files Browse the repository at this point in the history
…ally look for PNG support.
  • Loading branch information
dsokoloski committed Jan 2, 2012
1 parent 7c1fad0 commit 74bf3ca
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 90 deletions.
3 changes: 0 additions & 3 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
/* Define to 1 if you have the `freetype' library (-lfreetype). */
#undef HAVE_LIBFREETYPE

/* Define to 1 if you have the `png' library (-lpng). */
#undef HAVE_LIBPNG

/* Define to 1 if you have the `SDL' library (-lSDL). */
#undef HAVE_LIBSDL

Expand Down
92 changes: 21 additions & 71 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -15223,7 +15223,7 @@ _ACEOF

else

as_fn_error $? "libSDL not found but is required." "$LINENO" 5
as_fn_error $? "libSDL not found." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTF_Init in -lSDL_ttf" >&5
Expand Down Expand Up @@ -15271,12 +15271,12 @@ _ACEOF

else

as_fn_error $? "libSDL_ttf not found but is required." "$LINENO" 5
as_fn_error $? "libSDL_ttf not found." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IMG_Load_RW in -lSDL_image" >&5
$as_echo_n "checking for IMG_Load_RW in -lSDL_image... " >&6; }
if ${ac_cv_lib_SDL_image_IMG_Load_RW+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IMG_LoadPNG_RW in -lSDL_image" >&5
$as_echo_n "checking for IMG_LoadPNG_RW in -lSDL_image... " >&6; }
if ${ac_cv_lib_SDL_image_IMG_LoadPNG_RW+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
Expand All @@ -15290,27 +15290,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
char IMG_Load_RW ();
char IMG_LoadPNG_RW ();
int
main ()
{
return IMG_Load_RW ();
return IMG_LoadPNG_RW ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_SDL_image_IMG_Load_RW=yes
ac_cv_lib_SDL_image_IMG_LoadPNG_RW=yes
else
ac_cv_lib_SDL_image_IMG_Load_RW=no
ac_cv_lib_SDL_image_IMG_LoadPNG_RW=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_image_IMG_Load_RW" >&5
$as_echo "$ac_cv_lib_SDL_image_IMG_Load_RW" >&6; }
if test "x$ac_cv_lib_SDL_image_IMG_Load_RW" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_image_IMG_LoadPNG_RW" >&5
$as_echo "$ac_cv_lib_SDL_image_IMG_LoadPNG_RW" >&6; }
if test "x$ac_cv_lib_SDL_image_IMG_LoadPNG_RW" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSDL_IMAGE 1
_ACEOF
Expand All @@ -15319,7 +15319,7 @@ _ACEOF

else

as_fn_error $? "libSDL_image not found but is required." "$LINENO" 5
as_fn_error $? "libSDL_image with PNG support not found." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDLNet_UDP_Open in -lSDL_net" >&5
Expand Down Expand Up @@ -15367,7 +15367,7 @@ _ACEOF

else

as_fn_error $? "libSDL_net not found but is required." "$LINENO" 5
as_fn_error $? "libSDL_net not found." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5
Expand Down Expand Up @@ -15415,7 +15415,7 @@ _ACEOF

else

as_fn_error $? "libfreetype not found but is required." "$LINENO" 5
as_fn_error $? "libfreetype not found." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AES_cbc_encrypt in -lcrypto" >&5
Expand Down Expand Up @@ -15463,7 +15463,7 @@ _ACEOF

else

as_fn_error $? "libcrypto not found but is required." "$LINENO" 5
as_fn_error $? "libcrypto not found." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_init in -lavcodec" >&5
Expand Down Expand Up @@ -15511,7 +15511,7 @@ _ACEOF

else

as_fn_error $? "libavcodec not found but is required." "$LINENO" 5
as_fn_error $? "libavcodec not found." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for av_log_set_callback in -lavutil" >&5
Expand Down Expand Up @@ -15559,7 +15559,7 @@ _ACEOF

else

as_fn_error $? "libavutil not found but is required." "$LINENO" 5
as_fn_error $? "libavutil not found." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sws_getContext in -lswscale" >&5
Expand Down Expand Up @@ -15607,11 +15607,9 @@ _ACEOF

else

as_fn_error $? "libswscale not found but is required." "$LINENO" 5
as_fn_error $? "libswscale not found." "$LINENO" 5
fi

#AC_CHECK_LIB([faad], [faad_malloc], [], [
# AC_MSG_ERROR([libfaad not found but is required.])])
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5
$as_echo_n "checking for curl_easy_init in -lcurl... " >&6; }
if ${ac_cv_lib_curl_curl_easy_init+:} false; then :
Expand Down Expand Up @@ -15657,55 +15655,7 @@ _ACEOF

else

as_fn_error $? "libcurl not found but is required." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_malloc in -lpng" >&5
$as_echo_n "checking for png_malloc in -lpng... " >&6; }
if ${ac_cv_lib_png_png_malloc+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpng $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char png_malloc ();
int
main ()
{
return png_malloc ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_png_png_malloc=yes
else
ac_cv_lib_png_png_malloc=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_malloc" >&5
$as_echo "$ac_cv_lib_png_png_malloc" >&6; }
if test "x$ac_cv_lib_png_png_malloc" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPNG 1
_ACEOF

LIBS="-lpng $LIBS"

else

as_fn_error $? "libpng not found but is required." "$LINENO" 5
as_fn_error $? "libcurl not found." "$LINENO" 5
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5
Expand Down Expand Up @@ -15753,7 +15703,7 @@ _ACEOF

else

as_fn_error $? "libz not found but is required." "$LINENO" 5
as_fn_error $? "libz not found." "$LINENO" 5
fi


Expand Down
28 changes: 12 additions & 16 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,27 @@ AM_PROG_LIBTOOL

# Checks for libraries.
AC_CHECK_LIB([SDL], [SDL_Init], [], [
AC_MSG_ERROR([libSDL not found but is required.])])
AC_MSG_ERROR([libSDL not found.])])
AC_CHECK_LIB([SDL_ttf], [TTF_Init], [], [
AC_MSG_ERROR([libSDL_ttf not found but is required.])])
AC_CHECK_LIB([SDL_image], [IMG_Load_RW], [], [
AC_MSG_ERROR([libSDL_image not found but is required.])])
AC_MSG_ERROR([libSDL_ttf not found.])])
AC_CHECK_LIB([SDL_image], [IMG_LoadPNG_RW], [], [
AC_MSG_ERROR([libSDL_image with PNG support not found.])])
AC_CHECK_LIB([SDL_net], [SDLNet_UDP_Open], [], [
AC_MSG_ERROR([libSDL_net not found but is required.])])
AC_MSG_ERROR([libSDL_net not found.])])
AC_CHECK_LIB([freetype], [FT_Init_FreeType], [], [
AC_MSG_ERROR([libfreetype not found but is required.])])
AC_MSG_ERROR([libfreetype not found.])])
AC_CHECK_LIB([crypto], [AES_cbc_encrypt], [], [
AC_MSG_ERROR([libcrypto not found but is required.])])
AC_MSG_ERROR([libcrypto not found.])])
AC_CHECK_LIB([avcodec], [avcodec_init], [], [
AC_MSG_ERROR([libavcodec not found but is required.])])
AC_MSG_ERROR([libavcodec not found.])])
AC_CHECK_LIB([avutil], [av_log_set_callback], [], [
AC_MSG_ERROR([libavutil not found but is required.])])
AC_MSG_ERROR([libavutil not found.])])
AC_CHECK_LIB([swscale], [sws_getContext], [], [
AC_MSG_ERROR([libswscale not found but is required.])])
#AC_CHECK_LIB([faad], [faad_malloc], [], [
# AC_MSG_ERROR([libfaad not found but is required.])])
AC_MSG_ERROR([libswscale not found.])])
AC_CHECK_LIB([curl], [curl_easy_init], [], [
AC_MSG_ERROR([libcurl not found but is required.])])
AC_CHECK_LIB([png], [png_malloc], [], [
AC_MSG_ERROR([libpng not found but is required.])])
AC_MSG_ERROR([libcurl not found.])])
AC_CHECK_LIB([z], [deflate], [], [
AC_MSG_ERROR([libz not found but is required.])])
AC_MSG_ERROR([libz not found.])])

# Checks for header files.
AC_CHECK_HEADERS([malloc.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h])
Expand Down

0 comments on commit 74bf3ca

Please sign in to comment.