Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3177 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Dec 15, 2004, 2:57:03 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: finding sdl-image more flexible.

Location:
orxonox/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/config.h.in

    r3173 r3177  
    4040/* Define to 1 if you have the <png.h> header file. */
    4141#undef HAVE_PNG_H
     42
     43/* if we have SDL-image */
     44#undef HAVE_SDL_IMAGE
     45
     46/* Define to 1 if you have the <SDL_image.h> header file. */
     47#undef HAVE_SDL_IMAGE_H
    4248
    4349/* Define to 1 if you have the <SDL/SDL.h> header file. */
  • orxonox/trunk/configure

    r3173 r3177  
    60106010
    60116011else
     6012  echo "sdl_image not found. falling back to other options"; sdl_image_second_check=yes
     6013fi
     6014
     6015done
     6016
     6017  if test "$sdl_image_second_check" = yes ; then
     6018
     6019for ac_header in SDL_image.h
     6020do
     6021as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     6022if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6023  echo "$as_me:$LINENO: checking for $ac_header" >&5
     6024echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6025if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6026  echo $ECHO_N "(cached) $ECHO_C" >&6
     6027fi
     6028echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6029echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6030else
     6031  # Is the header compilable?
     6032echo "$as_me:$LINENO: checking $ac_header usability" >&5
     6033echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
     6034cat >conftest.$ac_ext <<_ACEOF
     6035/* confdefs.h.  */
     6036_ACEOF
     6037cat confdefs.h >>conftest.$ac_ext
     6038cat >>conftest.$ac_ext <<_ACEOF
     6039/* end confdefs.h.  */
     6040$ac_includes_default
     6041#include <$ac_header>
     6042_ACEOF
     6043rm -f conftest.$ac_objext
     6044if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
     6045  (eval $ac_compile) 2>conftest.er1
     6046  ac_status=$?
     6047  grep -v '^ *+' conftest.er1 >conftest.err
     6048  rm -f conftest.er1
     6049  cat conftest.err >&5
     6050  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6051  (exit $ac_status); } &&
     6052         { ac_try='test -z "$ac_c_werror_flag"
     6053                         || test ! -s conftest.err'
     6054  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6055  (eval $ac_try) 2>&5
     6056  ac_status=$?
     6057  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6058  (exit $ac_status); }; } &&
     6059         { ac_try='test -s conftest.$ac_objext'
     6060  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
     6061  (eval $ac_try) 2>&5
     6062  ac_status=$?
     6063  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6064  (exit $ac_status); }; }; then
     6065  ac_header_compiler=yes
     6066else
     6067  echo "$as_me: failed program was:" >&5
     6068sed 's/^/| /' conftest.$ac_ext >&5
     6069
     6070ac_header_compiler=no
     6071fi
     6072rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
     6073echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
     6074echo "${ECHO_T}$ac_header_compiler" >&6
     6075
     6076# Is the header present?
     6077echo "$as_me:$LINENO: checking $ac_header presence" >&5
     6078echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
     6079cat >conftest.$ac_ext <<_ACEOF
     6080/* confdefs.h.  */
     6081_ACEOF
     6082cat confdefs.h >>conftest.$ac_ext
     6083cat >>conftest.$ac_ext <<_ACEOF
     6084/* end confdefs.h.  */
     6085#include <$ac_header>
     6086_ACEOF
     6087if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
     6088  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
     6089  ac_status=$?
     6090  grep -v '^ *+' conftest.er1 >conftest.err
     6091  rm -f conftest.er1
     6092  cat conftest.err >&5
     6093  echo "$as_me:$LINENO: \$? = $ac_status" >&5
     6094  (exit $ac_status); } >/dev/null; then
     6095  if test -s conftest.err; then
     6096    ac_cpp_err=$ac_c_preproc_warn_flag
     6097    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
     6098  else
     6099    ac_cpp_err=
     6100  fi
     6101else
     6102  ac_cpp_err=yes
     6103fi
     6104if test -z "$ac_cpp_err"; then
     6105  ac_header_preproc=yes
     6106else
     6107  echo "$as_me: failed program was:" >&5
     6108sed 's/^/| /' conftest.$ac_ext >&5
     6109
     6110  ac_header_preproc=no
     6111fi
     6112rm -f conftest.err conftest.$ac_ext
     6113echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
     6114echo "${ECHO_T}$ac_header_preproc" >&6
     6115
     6116# So?  What about this header?
     6117case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
     6118  yes:no: )
     6119    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
     6120echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
     6121    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
     6122echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     6123    ac_header_preproc=yes
     6124    ;;
     6125  no:yes:* )
     6126    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
     6127echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
     6128    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
     6129echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
     6130    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
     6131echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
     6132    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
     6133echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
     6134    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
     6135echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     6136    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
     6137echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
     6138    (
     6139      cat <<\_ASBOX
     6140## ------------------------------------------- ##
     6141## Report this to orxonox-dev@mail.datacore.ch ##
     6142## ------------------------------------------- ##
     6143_ASBOX
     6144    ) |
     6145      sed "s/^/$as_me: WARNING:     /" >&2
     6146    ;;
     6147esac
     6148echo "$as_me:$LINENO: checking for $ac_header" >&5
     6149echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
     6150if eval "test \"\${$as_ac_Header+set}\" = set"; then
     6151  echo $ECHO_N "(cached) $ECHO_C" >&6
     6152else
     6153  eval "$as_ac_Header=\$ac_header_preproc"
     6154fi
     6155echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
     6156echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
     6157
     6158fi
     6159if test `eval echo '${'$as_ac_Header'}'` = yes; then
     6160  cat >>confdefs.h <<_ACEOF
     6161#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
     6162_ACEOF
     6163
     6164else
    60126165  echo "sdl_image not found. falling back to other options"; def_sdl_image=no
    60136166fi
     
    60156168done
    60166169
    6017 fi
     6170  fi
     6171fi
     6172
     6173
    60186174if test "$def_sdl_image" = "yes"; then
    60196175# checking for SDL_image-lib
     
    60826238     if test "$FOUND_SDL_image" = "yes" ; then
    60836239       LIBS="$LIBS -lSDL_image"
     6240
     6241cat >>confdefs.h <<_ACEOF
     6242#define HAVE_SDL_IMAGE 1
     6243_ACEOF
     6244
    60846245     else
    60856246        echo "------------------"
  • orxonox/trunk/configure.ac

    r3173 r3177  
    248248# checking for SDL_image-headers
    249249  AC_CHECK_HEADERS(SDL/SDL_image.h ,,
    250       [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
    251 fi
     250      [echo "sdl_image not found. falling back to other options"; sdl_image_second_check=yes ])
     251  if test "$sdl_image_second_check" = yes ; then
     252   AC_CHECK_HEADERS(SDL_image.h ,,
     253       [echo "sdl_image not found. falling back to other options"; def_sdl_image=no ])
     254  fi
     255fi
     256
     257
    252258if test "$def_sdl_image" = "yes"; then
    253259# checking for SDL_image-lib
     
    255261     if test "$FOUND_SDL_image" = "yes" ; then
    256262       LIBS="$LIBS -lSDL_image"
     263       AC_DEFINE_UNQUOTED(HAVE_SDL_IMAGE, 1, [if we have SDL-image])
    257264     else
    258265        echo "------------------"
  • orxonox/trunk/importer/material.cc

    r3140 r3177  
    494494
    495495
    496 #ifdef HAVE_SDL_SDL_IMAGE_H
     496#ifdef HAVE_SDL_IMAGE
    497497bool Material::loadImage(char* imageName, GLuint* texture)
    498498{
     
    529529
    530530
    531 #else /* HAVE_SDL_SDL_IMAGE_H */
     531#else /* HAVE_SDL_IMAGE */
    532532/**
    533533   \brief Makes the Programm ready to Read-in a texture-File
     
    12521252}
    12531253
    1254 #endif /* HAVE_SDL_SDL_IMAGE_H */
     1254#endif /* HAVE_SDL_IMAGE */
  • orxonox/trunk/importer/material.h

    r3140 r3177  
    1919#ifdef HAVE_SDL_SDL_IMAGE_H
    2020#include <SDL/SDL_image.h>
    21 #else
     21#endif
     22#ifdef HAVE_SDL_IMAGE_H
     23#include <SDL_image.h>
     24#endif
     25
     26#ifndef HAVE_SDL_IMAGE
    2227// IMAGE LIBS //
    2328#ifdef HAVE_JPEGLIB_H
     
    2934#include <png.h>
    3035#endif /* HAVE_PNG_H */
    31 #endif /* HAVE_SDL_SDL_IMAGE_H */
     36#endif /* HAVE_SDL_IMAGE */
    3237
    3338class PathList
     
    118123
    119124  bool loadImage(char* imageName, GLuint* texture);
    120 #ifndef HAVE_SDL_SDL_IMAGE_H
     125#ifndef HAVE_SDL_IMAGE
    121126
    122127  bool loadBMP (char* bmpName, GLuint* texture);
Note: See TracChangeset for help on using the changeset viewer.