sysinfo: Fix libpci detection
For some reason on my system `libpci` is found even though its not installed...? Plus I forgot a few headers being included.
This commit is contained in:
		
							parent
							
								
									3e53635dfb
								
							
						
					
					
						commit
						38f8cc8e0c
					
				
					 2 changed files with 9 additions and 7 deletions
				
			
		| 
						 | 
					@ -20,10 +20,14 @@ if system == 'linux' or system == 'darwin'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if system == 'linux'
 | 
					  if system == 'linux'
 | 
				
			||||||
    libpci = dependency('libpci', required: false)
 | 
					    libpci = dependency('libpci', required: false)
 | 
				
			||||||
    if libpci.found()
 | 
					    if libpci.found() and cc.has_header('pci/pci.h')
 | 
				
			||||||
      sysinfo_deps += libpci
 | 
					      sysinfo_deps += libpci
 | 
				
			||||||
      sysinfo_cargs += '-DHAVE_LIBPCI'
 | 
					      sysinfo_cargs += '-DHAVE_LIBPCI'
 | 
				
			||||||
      sysinfo_sources += 'unix/pci.c'
 | 
					      sysinfo_sources += 'unix/pci.c'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      picidsdir = libpci.get_pkgconfig_variable('idsdir')
 | 
				
			||||||
 | 
					      pciids = join_paths(picidsdir, 'pci.ids')
 | 
				
			||||||
 | 
					      sysinfo_cargs += '-DPCIIDS_FILE="@0@"'.format(pciids)
 | 
				
			||||||
    endif
 | 
					    endif
 | 
				
			||||||
    sysinfo_includes += 'unix'
 | 
					    sysinfo_includes += 'unix'
 | 
				
			||||||
    sysinfo_sources += [
 | 
					    sysinfo_sources += [
 | 
				
			||||||
| 
						 | 
					@ -31,10 +35,6 @@ if system == 'linux' or system == 'darwin'
 | 
				
			||||||
      'unix/match.c',
 | 
					      'unix/match.c',
 | 
				
			||||||
      'unix/parse.c',
 | 
					      'unix/parse.c',
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
 | 
					 | 
				
			||||||
    picidsdir = libpci.get_pkgconfig_variable('idsdir')
 | 
					 | 
				
			||||||
    pciids = join_paths(picidsdir, 'pci.ids')
 | 
					 | 
				
			||||||
    sysinfo_cargs += '-DPCIIDS_FILE="@0@"'.format(pciids)
 | 
					 | 
				
			||||||
  elif system == 'darwin'
 | 
					  elif system == 'darwin'
 | 
				
			||||||
    add_languages('objc')
 | 
					    add_languages('objc')
 | 
				
			||||||
    sysinfo_sources += 'osx/backend.m'
 | 
					    sysinfo_sources += 'osx/backend.m'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,14 +23,16 @@
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <string.h>
 | 
					#include <string.h>
 | 
				
			||||||
#include <ctype.h>
 | 
					#include <ctype.h>
 | 
				
			||||||
#include <pci/header.h>
 | 
					#ifdef HAVE_LIBPCI
 | 
				
			||||||
 | 
						#include <pci/header.h>
 | 
				
			||||||
 | 
						#include "pci.h"
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
#include <glib.h>
 | 
					#include <glib.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef __sparc__
 | 
					#ifdef __sparc__
 | 
				
			||||||
#include <dirent.h>
 | 
					#include <dirent.h>
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "pci.h"
 | 
					 | 
				
			||||||
#include "match.h"
 | 
					#include "match.h"
 | 
				
			||||||
#include "parse.h"
 | 
					#include "parse.h"
 | 
				
			||||||
#include "sysinfo.h"
 | 
					#include "sysinfo.h"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue