Skip to content

Commit

Permalink
enable more options
Browse files Browse the repository at this point in the history
  • Loading branch information
kjmeagher committed Nov 2, 2024
1 parent 51fc00c commit e3a4b31
Showing 1 changed file with 64 additions and 80 deletions.
144 changes: 64 additions & 80 deletions subprojects/packagefiles/cfitsio/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -60,60 +60,44 @@ else
endif
endif

# if get_option('hera')
# add_project_arguments('-DBUILD_HERA=1', language: 'c')
# endif
if get_option('hera')
add_project_arguments('-DBUILD_HERA=1', language: 'c')
endif

# if cc.get_id() != 'msvc' and cc.has_function('gethostbyname') and cc.has_function(
# 'connect',
# )
# add_project_arguments('-DHAVE_NET_SERVICES', language: 'c')
# if cc.has_header_symbol('stdio.h', 'fmemopen')
# add_project_arguments('-DHAVE_FMEMOPEN', language: 'c')
# endif
# endif

# if get_option('sse2')
# if cc.has_argument('-msse2')
# add_project_arguments('-msse2', language: 'c')
# elif cc.get_id() == 'msvc'
# add_project_arguments('-D__SSE2__=1', language: 'c')
# endif
# endif

# if get_option('ssse3')
# if cc.has_argument('-mssse3')
# add_project_arguments('-mssse3', language: 'c')
# elif cc.get_id() == 'msvc'
# add_project_arguments('-D__SSE2__=1', '-D__SSSE3__=1', language: 'c')
# endif
# endif

if cc.has_function('gethostbyname') and cc.has_function('connect')
add_project_arguments('-DHAVE_NET_SERVICES', language: 'c')
if cc.has_header_symbol('stdio.h', 'fmemopen')
add_project_arguments('-DHAVE_FMEMOPEN', language: 'c')
endif
endif


# shmem_prefix = [
# '#include <sys/ipc.h>',
# '#include <sys/shm.h>',
# '#include <sys/sem.h>',
# ]
# flock_prefix = ['#include <sys/flock.h>']
shmem_prefix = [
'#include <sys/ipc.h>',
'#include <sys/shm.h>',
'#include <sys/sem.h>',
]
flock_prefix = ['#include <sys/flock.h>']

# have_shmem_services = true
# foreach func : ['shmat', 'shmdt', 'shmget', 'semget']
# have_shmem_services = have_shmem_services and cc.has_function(
# func,
# prefix: shmem_prefix,
# )
# endforeach
# if have_shmem_services
# add_project_arguments('-DHAVE_SHMEM_SERVICES', language: 'c')
# if cc.has_type('flock_t', prefix: flock_prefix)
# add_project_arguments('-DHAVE_FLOCK_T', language: 'c')
# endif
# if cc.has_type('union semun', prefix: shmem_prefix)
# add_project_arguments('-DHAVE_UNION_SEMUN', language: 'c')
# endif
# endif
have_shmem_services = true
foreach func : ['shmat', 'shmdt', 'shmget', 'semget']
have_shmem_services = have_shmem_services and cc.has_function(
func,
prefix: shmem_prefix,
)
endforeach
if have_shmem_services
add_project_arguments('-DHAVE_SHMEM_SERVICES', language: 'c')
if cc.has_type('flock_t', prefix: flock_prefix)
add_project_arguments('-DHAVE_FLOCK_T', language: 'c')
endif
if cc.has_type('union semun', prefix: shmem_prefix)
add_project_arguments('-DHAVE_UNION_SEMUN', language: 'c')
endif
endif

if cc.has_type('long long')
add_project_arguments('-DHAVE_LONGLONG', language: 'c')
Expand Down Expand Up @@ -218,39 +202,39 @@ pkg.generate(
)

if get_option('utils')
# executable(
# 'fitscopy',
# 'utilities/fitscopy.c',
# link_with: libcfitsio,
# install: true,
# )
# executable(
# 'fitsverify',
# 'utilities/ftverify.c',
# 'utilities/fvrf_data.c',
# 'utilities/fvrf_file.c',
# 'utilities/fvrf_head.c',
# 'utilities/fvrf_key.c',
# 'utilities/fvrf_misc.c',
# c_args: '-DSTANDALONE',
# dependencies: cfitsio_dep,
# install: true,
# )
# executable(
# 'fpack',
# 'utilities/fpack.c',
# 'utilities/fpackutil.c',
# dependencies: exe_deps + cfitsio_dep,
# install: true,
# )
# executable(
# 'funpack',
# 'utilities/funpack.c',
# 'utilities/fpackutil.c',
# dependencies: exe_deps + cfitsio_dep,
# link_with: libcfitsio,
# install: true,
# )
executable(
'fitscopy',
'utilities/fitscopy.c',
dependencies: cfitsio_dep,
install: true,
)
executable(
'fitsverify',
'utilities/ftverify.c',
'utilities/fvrf_data.c',
'utilities/fvrf_file.c',
'utilities/fvrf_head.c',
'utilities/fvrf_key.c',
'utilities/fvrf_misc.c',
c_args: '-DSTANDALONE',
dependencies: cfitsio_dep,
install: true,
)
executable(
'fpack',
'utilities/fpack.c',
'utilities/fpackutil.c',
dependencies: cfitsio_dep,
install: true,
)
executable(
'funpack',
'utilities/funpack.c',
'utilities/fpackutil.c',
dependencies: cfitsio_dep,
link_with: libcfitsio,
install: true,
)
endif

test(
Expand Down

0 comments on commit e3a4b31

Please sign in to comment.