# HG changeset patch # User diego # Date 1277366621 0 # Node ID f356309ee2f842983ac7fd8bb251566c31f672bb # Parent bd0f47e100f85f50a54d8c9aa9a2ae1fdaf51d4c Replace manual header checks by header_check function. diff -r bd0f47e100f8 -r f356309ee2f8 configure --- a/configure Wed Jun 23 23:56:10 2010 +0000 +++ b/configure Thu Jun 24 08:03:41 2010 +0000 @@ -2720,11 +2720,7 @@ if $(cc_check -maltivec -mabi=altivec) ; then _altivec_gcc_flags="-maltivec -mabi=altivec" # check if should be included - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF - if $(cc_check $_altivec_gcc_flags) ; then + if $(header_check altivec.h $_altivec_gcc_flags) ; then def_altivec_h='#define HAVE_ALTIVEC_H 1' inc_altivec_h='#include ' else @@ -3266,11 +3262,8 @@ echocheck "arpa/inet.h" arpa_inet_h=no def_arpa_inet_h='#define HAVE_ARPA_INET_H 0' -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF -cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1' +header_check arpa_inet.h && arpa_inet_h=yes && + def_arpa_inet_h='#define HAVE_ARPA_INET_H 1' echores "$arpa_inet_h" @@ -3408,21 +3401,13 @@ echocheck "inttypes.h (required)" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _inttypes=no -cc_check && _inttypes=yes +header_check inttypes.h && _inttypes=yes echores "$_inttypes" if test "$_inttypes" = no ; then - echocheck "bitypes.h (inttypes.h predecessor)" - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF - cc_check && _inttypes=yes + echocheck "sys/bitypes.h (inttypes.h predecessor)" + header_check sys/bitypes.h && _inttypes=yes if test "$_inttypes" = yes ; then die "You don't have inttypes.h, but sys/bitypes.h is present. Please copy etc/inttypes.h into the include path, and re-run configure." else @@ -3455,12 +3440,8 @@ echocheck "malloc.h" -cat > $TMPC << EOF -#include -int main(void) { (void) malloc(0); return 0; } -EOF _malloc=no -cc_check && _malloc=yes +header_check malloc.h && _malloc=yes if test "$_malloc" = yes ; then def_malloc_h='#define HAVE_MALLOC_H 1' else @@ -3712,11 +3693,8 @@ def_soundcard_h='#undef HAVE_SOUNDCARD_H' def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H' for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do - cat > $TMPC << EOF -#include <$_soundcard_header> -int main(void) { return 0; } -EOF - cc_check && _soundcard_h=yes && res_comment="$_soundcard_header" && break + header_check $_soundcard_header && _soundcard_h=yes && + res_comment="$_soundcard_header" && break done if test "$_soundcard_h" = yes ; then @@ -3730,12 +3708,8 @@ echocheck "sys/dvdio.h" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _dvdio=no -cc_check && _dvdio=yes +header_check sys/dvdio.h && _dvdio=yes if test "$_dvdio" = yes ; then def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1' else @@ -3745,12 +3719,8 @@ echocheck "sys/cdio.h" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _cdio=no -cc_check && _cdio=yes +header_check sys/cdio.h && _cdio=yes if test "$_cdio" = yes ; then def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1' else @@ -3760,12 +3730,8 @@ echocheck "linux/cdrom.h" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _cdrom=no -cc_check && _cdrom=yes +header_check linux/cdrom.h && _cdrom=yes if test "$_cdrom" = yes ; then def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1' else @@ -3775,12 +3741,8 @@ echocheck "dvd.h" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _dvd=no -cc_check && _dvd=yes +header_check dvd.h && _dvd=yes if test "$_dvd" = yes ; then def_dvd='#define DVD_STRUCT_IN_DVD_H 1' else @@ -3791,12 +3753,8 @@ if bsdos; then echocheck "BSDI dvd.h" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _bsdi_dvd=no -cc_check && _bsdi_dvd=yes +header_check dvd.h && _bsdi_dvd=yes if test "$_bsdi_dvd" = yes ; then def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1' else @@ -3809,12 +3767,8 @@ if hpux; then # also used by AIX, but AIX does not support VCD and/or libdvdread echocheck "HP-UX SCSI header" -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _hpux_scsi_h=no -cc_check && _hpux_scsi_h=yes +header_check sys/scsi.h && _hpux_scsi_h=yes if test "$_hpux_scsi_h" = yes ; then def_hpux_scsi_h='#define HPUX_SCTL_IO 1' else @@ -3826,13 +3780,9 @@ if sunos; then echocheck "userspace SCSI headers (Solaris)" -cat > $TMPC << EOF -#include -#include -int main(void) { return 0; } -EOF _sol_scsi_h=no -cc_check && _sol_scsi_h=yes +header_check sys/scsi/scsi_types.h && header_check sys/scsi/impl/uscsi.h && + _sol_scsi_h=yes if test "$_sol_scsi_h" = yes ; then def_sol_scsi_h='#define SOLARIS_USCSI 1' else @@ -3871,11 +3821,8 @@ if test "$_termios" = auto ; then _termios=no for _termios_header in "termios.h" "sys/termios.h"; do - cat > $TMPC < -int main(void) { return 0; } -EOF - cc_check && _termios=yes && res_comment="using $_termios_header" && break + header_check $_termios_header && _termios=yes && + res_comment="using $_termios_header" && break done fi @@ -4891,12 +4838,8 @@ echocheck "SVGAlib" if test "$_svga" = auto ; then - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _svga=no - cc_check -lvga $_ld_lm && _svga=yes + header_check vga.h -lvga $_ld_lm && _svga=yes fi if test "$_svga" = yes ; then def_svga='#define CONFIG_SVGALIB 1' @@ -5526,12 +5469,8 @@ echocheck "DXR2" if test "$_dxr2" = auto; then _dxr2=no - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do - cc_check $_inc_tmp && _dxr2=yes && \ + header_check dxr2ioctl.h $_inc_tmp && _dxr2=yes && extra_cflags="$extra_cflags $_inc_tmp" && break done fi @@ -5548,12 +5487,8 @@ echocheck "DXR3/H+" if test "$_dxr3" = auto ; then - cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF _dxr3=no - cc_check && _dxr3=yes + header_check linux/em8300.h && _dxr3=yes fi if test "$_dxr3" = yes ; then def_dxr3='#define CONFIG_DXR3 1' @@ -5680,13 +5615,8 @@ if test "$_arts" = auto ; then _arts=no if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then - -cat > $TMPC << EOF -#include -int main(void) { return 0; } -EOF -cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes - + header_check artsc.h $(artsc-config --libs) $(artsc-config --cflags) && + _arts=yes fi fi @@ -5738,12 +5668,8 @@ echocheck "NAS" if test "$_nas" = auto ; then - cat > $TMPC << EOF -#include