Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3110 in orxonox.OLD


Ignore:
Timestamp:
Dec 6, 2004, 1:11:56 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/images: test for jpeg and png libs in configure.ac and material.cc/h

Location:
orxonox/branches/images
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/images/configure

    r3108 r3110  
    54965496 osX="yes"
    54975497
     5498 CPPFLAGS="-I/sw/include $CPPFLAGS"
    54985499# checking gl header
    54995500
     
    58255826       LIBS="$LIBS $SDL_LIBS"
    58265827
    5827        def_sdl_image=no;
    58285828    ;;
    58295829
     
    62136213#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
    62146214_ACEOF
    6215 
    6216 else
    6217   { { echo "$as_me:$LINENO: error: cannot find jpeg headers" >&5
    6218 echo "$as_me: error: cannot find jpeg headers" >&2;}
    6219    { (exit 1); exit 1; }; }
     6215 jpegHeader="yes"
     6216else
     6217  jpegHeader="no"
    62206218fi
    62216219
    62226220done
    62236221
    6224 
    6225  echo "$as_me:$LINENO: checking for main in -ljpeg" >&5
     6222 if test $jpegHeader = "no"; then
     6223        echo " not including jpeg."
     6224 else
     6225  echo "$as_me:$LINENO: checking for main in -ljpeg" >&5
    62266226echo $ECHO_N "checking for main in -ljpeg... $ECHO_C" >&6
    62276227if test "${ac_cv_lib_jpeg_main+set}" = set; then
     
    62946294         exit -1
    62956295    fi
    6296 
     6296 fi
    62976297
    62986298 ## checking for libpng
     
    64426442#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
    64436443_ACEOF
    6444 
    6445 else
    6446   { { echo "$as_me:$LINENO: error: cannot find jpeg headers" >&5
    6447 echo "$as_me: error: cannot find jpeg headers" >&2;}
    6448    { (exit 1); exit 1; }; }
     6444 pngHeader="yes"
     6445else
     6446  pngHeader="no"
    64496447fi
    64506448
    64516449done
    64526450
    6453 
    6454  echo "$as_me:$LINENO: checking for main in -lpng" >&5
     6451 if test $pngHeader = "no"; then
     6452        echo " not including png."
     6453 else
     6454  echo "$as_me:$LINENO: checking for main in -lpng" >&5
    64556455echo $ECHO_N "checking for main in -lpng... $ECHO_C" >&6
    64566456if test "${ac_cv_lib_png_main+set}" = set; then
     
    65236523         exit -1
    65246524    fi
     6525 fi
    65256526fi
    65266527
  • orxonox/branches/images/configure.ac

    r3109 r3110  
    255255if test "$def_sdl_image" = "no"; then
    256256 ## checking for libjpeg
    257  AC_CHECK_HEADERS(jpeglib.h ,,
    258         [AC_MSG_ERROR([cannot find jpeg headers]) ])
    259 
    260  AC_CHECK_LIB([jpeg], [main], FOUND_jpeg=yes)
     257 AC_CHECK_HEADERS(jpeglib.h ,jpegHeader="yes",
     258        jpegHeader="no")
     259 if test $jpegHeader = "no"; then
     260        echo " not including jpeg."
     261 else
     262  AC_CHECK_LIB([jpeg], [main], FOUND_jpeg=yes)
    261263    if test "$FOUND_jpeg" = "yes" ; then
    262264      LIBS="$LIBS -ljpeg"
     
    268270         exit -1
    269271    fi   
    270 
     272 fi
    271273
    272274 ## checking for libpng
    273  AC_CHECK_HEADERS(png.h ,,
    274         [AC_MSG_ERROR([cannot find jpeg headers]) ])
    275 
    276  AC_CHECK_LIB([png], [main], FOUND_png=yes)
     275 AC_CHECK_HEADERS(png.h ,pngHeader="yes",
     276        pngHeader="no")
     277 if test $pngHeader = "no"; then
     278        echo " not including png."
     279 else
     280  AC_CHECK_LIB([png], [main], FOUND_png=yes)
    277281    if test "$FOUND_png" = "yes" ; then
    278282      LIBS="$LIBS -lpng"
     
    283287         echo "------------------"
    284288         exit -1
    285     fi   
     289    fi
     290 fi   
    286291fi
    287292
  • orxonox/branches/images/importer/material.cc

    r3108 r3110  
    564564bool Material::loadJPG (char* jpgName, GLuint* texture)
    565565{
     566#ifdef HAVE_JPEGLIB_H
    566567  struct jpeg_decompress_struct cinfo;
    567568  Image *pImage = NULL;
     
    649650    }
    650651  return true;
     652#else /* HAVE_JPEGLIB_H */
     653  if (verbose >=1)
     654    printf ("sorry, but you did not compile with jpeg-support.\nEither install SDL_image or jpeglib, and recompile to see the image\n");
     655  return false;
     656#endif /* HAVE_JPEGLIB_H */
     657
    651658}
    652659
     
    980987bool Material::loadPNG(const char* pngName, GLuint* texture)
    981988{
     989#ifdef HAVE_PNG_H
    982990  Image* pImage = new Image;
    983991
     
    10991107 
    11001108  return true;
     1109#else /* HAVE_PNG_H */
     1110  if (verbose >=1)
     1111    printf ("sorry, but you did not compile with png-support.\nEither install SDL_image or libpng, and recompile to see the image\n");
     1112  return false;
     1113#endif /* HAVE_PNG_H */
     1114
    11011115}
    11021116
  • orxonox/branches/images/importer/material.h

    r3104 r3110  
    1717#if HAVE_CONFIG_H
    1818#include <config.h>
    19 #endif
     19#endif /* HAVE_CONFIG_H */
    2020
    2121#ifdef HAVE_SDL_SDL_IMAGE_H
     
    2323#else
    2424// IMAGE LIBS //
     25#ifdef HAVE_JPEGLIB_H
    2526extern "C"{         // This has to be done, because not a c++ lib
    2627#include <jpeglib.h>
    2728}
     29#endif /* HAVE_JPEGLIB_H */
     30#ifdef HAVE_PNG_H
    2831#include <png.h>
    29 #endif
     32#endif /* HAVE_PNG_H */
     33#endif /* HAVE_SDL_SDL_IMAGE_H */
    3034
    3135//! Class to handle Materials.
Note: See TracChangeset for help on using the changeset viewer.