Skip to content

Commit

Permalink
Update meson.build
Browse files Browse the repository at this point in the history
  • Loading branch information
dgsga authored Feb 29, 2024
1 parent 52c2996 commit cc48694
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -352,41 +352,45 @@ bdb_subdirs = [
'db6.1',
]

foreach dir : bdb_subdirs
if fs.exists('/usr/local/include' / dir / 'db.h')
bdb_header += '/usr/local/include' / dir / 'db.h'
bdb_libdir += '/usr/local/lib'
bdb_includes += include_directories('/usr/local/include/' + dir)
endif
endforeach
if bdb_header == ''
foreach dir : bdb_subdirs
if fs.exists('/usr/pkg/include' / dir / 'db.h')
bdb_header += '/usr/pkg/include' / dir / 'db.h'
bdb_libdir += '/usr/pkg/lib'
bdb_includes += include_directories('/usr/pkg/include' / dir)
endif
endforeach
endif
if bdb_header == ''
if get_option('with-bdb') == ''
foreach dir : bdb_subdirs
if fs.exists('/usr/include' / dir / 'db.h')
bdb_header = '/usr/include' / dir / 'db.h'
bdb_link_args += '-L/usr/lib'
bdb_libdir += '/usr/lib'
bdb_includes += include_directories('/usr/include/' + dir)
if fs.exists('/usr/local/include' / dir / 'db.h')
bdb_header += '/usr/local/include' / dir / 'db.h'
bdb_libdir += '/usr/local/lib'
bdb_includes += include_directories('/usr/local/include/' + dir)
endif
endforeach
endif

if get_option('with-bdb') != ''
if bdb_header == ''
foreach dir : bdb_subdirs
if fs.exists('/usr/pkg/include' / dir / 'db.h')
bdb_header += '/usr/pkg/include' / dir / 'db.h'
bdb_libdir += '/usr/pkg/lib'
bdb_includes += include_directories('/usr/pkg/include' / dir)
endif
endforeach
endif
if bdb_header == ''
foreach dir : bdb_subdirs
if fs.exists('/usr/include' / dir / 'db.h')
bdb_header = '/usr/include' / dir / 'db.h'
bdb_link_args += '-L/usr/lib'
bdb_libdir += '/usr/lib'
bdb_includes += include_directories('/usr/include/' + dir)
endif
endforeach
endif
elif get_option('with-bdb') != ''
foreach dir : bdb_subdirs
if fs.exists(with_bdb / 'include' / dir / 'db.h')
bdb_header += with_bdb + '/include/' + dir + 'db.h'
bdb_libdir += with_bdb / 'lib'
bdb_includes += include_directories(with_bdb + '/include/' + dir)
endif
endforeach
else
error(
'Berkeley DB library required but not found! Please specify an installation path using the -Dwith-bdb= configure option (must include lib and include dirs)',
)
endif

if bdb_header != ''
Expand Down Expand Up @@ -456,10 +460,6 @@ if bdb_minimum_version
if enable_dtags
bdb_link_args += '-Wl,--enable-new-dtags'
endif
else
error(
'Berkeley DB library required but not found! Please specify an installation path using the -Dwith-bdb= configure option (must include lib and include dirs)',
)
endif

message('BDB header: ', bdb_header)
Expand Down

0 comments on commit cc48694

Please sign in to comment.