mirror of https://git.wownero.com/dsc/mxe.git
package cfitsio: add test program
This commit is contained in:
parent
ed33714424
commit
b2dbb6d384
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* This file is part of MXE.
|
||||
* See index.html for further information.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "fitsio.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
|
||||
fitsfile *fptr;
|
||||
char card[FLEN_CARD];
|
||||
int status = 0, nkeys, ii; /* MUST initialize status */
|
||||
|
||||
fits_open_file(&fptr, argv[1], READONLY, &status);
|
||||
fits_get_hdrspace(fptr, &nkeys, NULL, &status);
|
||||
|
||||
for (ii = 1; ii <= nkeys; ii++) {
|
||||
fits_read_record(fptr, ii, card, &status); /* read keyword */
|
||||
printf("%s\n", card);
|
||||
}
|
||||
printf("END\n\n"); /* terminate listing with END */
|
||||
fits_close_file(fptr, &status);
|
||||
|
||||
if (status) /* print any error messages */
|
||||
fits_report_error(stderr, status);
|
||||
return(status);
|
||||
}
|
|
@ -15,7 +15,13 @@ endef
|
|||
define $(PKG)_BUILD
|
||||
cd '$(1)' && ./configure \
|
||||
--host='$(TARGET)' \
|
||||
--prefix='$(PREFIX)/$(TARGET)'
|
||||
$(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
|
||||
$(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
FC='$(TARGET)-gfortran'
|
||||
$(MAKE) -C '$(1)' -j '$(JOBS)'
|
||||
$(MAKE) -C '$(1)' -j 1 install
|
||||
|
||||
'$(TARGET)-gcc' \
|
||||
-W -Wall -Werror -ansi \
|
||||
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-cfitsio.exe' \
|
||||
`'$(TARGET)-pkg-config' cfitsio --cflags --libs`
|
||||
endef
|
||||
|
|
Loading…
Reference in New Issue