Compare commits

...

1 Commits

Author SHA1 Message Date
Zhu Qun-Ying 400c2b71b6 use meson build 2024-02-22 20:08:53 -08:00
15 changed files with 338 additions and 8 deletions

4
.gitignore vendored
View File

@ -3,8 +3,6 @@
*.a
*.o
/GUI/xephem/xephem
/GUI/xephem/xephem.1
.cache
# macOS HFS+ files
._*

View File

@ -197,14 +197,11 @@ OBJS = \
xephem.o \
xmisc.o
all: libs xephem xephem.1
all: libs xephem
xephem: $(INCS) $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
xephem.1: xephem.man
nroff -man $? > $@
libs:
cd ../../libastro; make
cd ../../libip; make
@ -217,4 +214,4 @@ clean:
rm -fr *.o ../../lib*/*.[ao]
clobber: clean
rm -fr xephem xephem.1
rm -fr xephem

9
GUI/xephem/meson.build Normal file
View File

@ -0,0 +1,9 @@
install_man('xephem.1')
install_data('XEphem.png', install_dir: get_option('datadir') / 'pixmaps')
install_subdir('auxil', install_dir: xephem_data_dir, strip_directory : false)
install_subdir('catalogs', install_dir: xephem_data_dir, strip_directory : false)
install_subdir('fifos', install_dir: xephem_data_dir, strip_directory : false)
install_subdir('fits', install_dir: xephem_data_dir, strip_directory : false)
install_subdir('gallery', install_dir: xephem_data_dir, strip_directory : false)
install_subdir('help', install_dir: xephem_data_dir, strip_directory : false)
install_subdir('lo', install_dir: xephem_data_dir, strip_directory : false)

2
XEphem.in Normal file
View File

@ -0,0 +1,2 @@
XEphem.ShareDir: @DATADIR@
XEphem.PrivateDir: ~/.xephem

63
libastro/meson.build Normal file
View File

@ -0,0 +1,63 @@
libastro_src = [
'aa_hadec.c',
'aberration.c',
'actan.c',
'airmass.c',
'anomaly.c',
'ap_as.c',
'atlas.c',
'auxil.c',
'bdl.c',
'chap95.c',
'chap95_data.c',
'circum.c',
'comet.c',
'constel.c',
'dbfmt.c',
'deep.c',
'deltat.c',
'earthsat.c',
'eq_ecl.c',
'eq_gal.c',
'formats.c',
'helio.c',
'jupmoon.c',
'libration.c',
'magdecl.c',
'marsmoon.c',
'misc.c',
'mjd.c',
'moon.c',
'mooncolong.c',
'moonnf.c',
'nutation.c',
'obliq.c',
'parallactic.c',
'parallax.c',
'plans.c',
'plmoon.c',
'plshadow.c',
'precess.c',
'reduce.c',
'refract.c',
'rings.c',
'riset.c',
'riset_cir.c',
'satmoon.c',
'sdp4.c',
'sgp4.c',
'sphcart.c',
'sun.c',
'thetag.c',
'twobody.c',
'umoon.c',
'utc_gst.c',
'vsop87.c',
'vsop87_data.c',
]
libastro_inc = include_directories('./')
libastro = static_library('astro', libastro_src,
include_directories : libastro_inc)

18
libip/meson.build Normal file
View File

@ -0,0 +1,18 @@
libip_src = [
'explodegif.c',
'fits.c',
'fsmatch.c',
'gaussfit.c',
'lstsqr.c',
'median.c',
'sqr.c',
'stars.c',
'stats.c',
'walk.c',
'wcs.c',
]
libip_inc = include_directories('../libastro')
libip = static_library('ip', libip_src,
include_directories: libip_inc)

30
libjpegd/meson.build Normal file
View File

@ -0,0 +1,30 @@
libjpegd_src = [
'jcomapi.c',
'jdapimin.c',
'jdapistd.c',
'jdatasrc.c',
'jdcoefct.c',
'jdcolor.c',
'jddctmgr.c',
'jdhuff.c',
'jdinput.c',
'jdmainct.c',
'jdmarker.c',
'jdmaster.c',
'jdmerge.c',
'jdphuff.c',
'jdpostct.c',
'jdsample.c',
'jerror.c',
'jidctflt.c',
'jidctfst.c',
'jidctint.c',
'jidctred.c',
'jmemmgr.c',
'jmemnobs.c',
'jquant1.c',
'jquant2.c',
'jutils.c',
]
libjpeg = static_library('jpegd', libjpegd_src)

6
liblilxml/meson.build Normal file
View File

@ -0,0 +1,6 @@
liblilxml_src = [
'base64.c',
'lilxml.c'
]
liblilxml = static_library('lilxml', liblilxml_src)

19
libpng/meson.build Normal file
View File

@ -0,0 +1,19 @@
libpng_src = [
'png.c',
'pngerror.c',
'pngget.c',
'pngmem.c',
'pngpread.c',
'pngread.c',
'pngrio.c',
'pngrtran.c',
'pngrutil.c',
'pngset.c',
'pngtrans.c',
'pngwio.c',
'pngwrite.c',
'pngwtran.c',
'pngwutil.c',
]
libpng = static_library('png', libpng_src)

15
libz/meson.build Normal file
View File

@ -0,0 +1,15 @@
libz_src = [
'adler32.c',
'compress.c',
'crc32.c',
'deflate.c',
'inffast.c',
'inflate.c',
'inftrees.c',
'testzlib.c',
'trees.c',
'uncompr.c',
'zutil.c',
]
libz = static_library('z', libz_src)

155
meson.build Normal file
View File

@ -0,0 +1,155 @@
project('XEphem', 'c',
version : '4.1.0',
default_options : [
'warning_level=3',
'b_lto=true',
'optimization=2'
])
inc_dirs = include_directories('libastro', 'libip', 'liblilxml')
src=[
'GUI/xephem/aavso.c',
'GUI/xephem/annotmenu.c',
'GUI/xephem/broadcast.c',
'GUI/xephem/calmenu.c',
'GUI/xephem/closemenu.c',
'GUI/xephem/compiler.c',
'GUI/xephem/coordsmenu.c',
'GUI/xephem/datamenu.c',
'GUI/xephem/db.c',
'GUI/xephem/dbmenu.c',
'GUI/xephem/earthmap.c',
'GUI/xephem/earthmenu.c',
'GUI/xephem/fallbacks.c',
'GUI/xephem/favmenu.c',
'GUI/xephem/formats.c',
'GUI/xephem/fsmenu.c',
'GUI/xephem/gallerymenu.c',
'GUI/xephem/glance.c',
'GUI/xephem/gsc.c',
'GUI/xephem/gscnet.c',
'GUI/xephem/helpmenu.c',
'GUI/xephem/homeio.c',
'GUI/xephem/hznmenu.c',
'GUI/xephem/imregmenu.c',
'GUI/xephem/indimenu.c',
'GUI/xephem/jpeg2pm.c',
'GUI/xephem/jupmenu.c',
'GUI/xephem/listmenu.c',
'GUI/xephem/mainmenu.c',
'GUI/xephem/marsmenu.c',
'GUI/xephem/marsmmenu.c',
'GUI/xephem/moonmenu.c',
'GUI/xephem/moviemenu.c',
'GUI/xephem/msgmenu.c',
'GUI/xephem/netmenu.c',
'GUI/xephem/objmenu.c',
'GUI/xephem/obslog.c',
'GUI/xephem/patchlevel.c',
'GUI/xephem/plot_aux.c',
'GUI/xephem/plotmenu.c',
'GUI/xephem/preferences.c',
'GUI/xephem/progress.c',
'GUI/xephem/ps.c',
'GUI/xephem/query.c',
'GUI/xephem/rotated.c',
'GUI/xephem/satmenu.c',
'GUI/xephem/saveres.c',
'GUI/xephem/scope.c',
'GUI/xephem/sites.c',
'GUI/xephem/skybinary.c',
'GUI/xephem/skyeyep.c',
'GUI/xephem/skyfifos.c',
'GUI/xephem/skyfiltmenu.c',
'GUI/xephem/skyfits.c',
'GUI/xephem/skyhist.c',
'GUI/xephem/skyip.c',
'GUI/xephem/skylist.c',
'GUI/xephem/skytoolbar.c',
'GUI/xephem/skyviewmenu.c',
'GUI/xephem/solsysmenu.c',
'GUI/xephem/splash.c',
'GUI/xephem/srchmenu.c',
'GUI/xephem/sunmenu.c',
'GUI/xephem/time.c',
'GUI/xephem/tips.c',
'GUI/xephem/trailmenu.c',
'GUI/xephem/ucac.c',
'GUI/xephem/uranusmenu.c',
'GUI/xephem/usno.c',
'GUI/xephem/versionmenu.c',
'GUI/xephem/webdbmenu.c',
'GUI/xephem/xe2.c',
'GUI/xephem/xe3.c',
'GUI/xephem/xephem.c',
'GUI/xephem/xmisc.c',
]
ccompiler = meson.get_compiler('c')
empty_dep = dependency('', required:false)
motif_dep = ccompiler.find_library('Xm')
xt_dep = ccompiler.find_library('Xt')
x_dep = dependency('X11')
openssl_dep = dependency('openssl')
m_dep = ccompiler.find_library('m', required: false)
if m_dep.found()
add_project_link_arguments('-lm', language : 'c')
if get_option('with-sys-zlib')
zlib_dep = dependency('zlib')
libz = []
zlib_inc = []
else
zlib_dep = empty_dep
subdir('libz')
zlib_inc = include_directories('libz')
endif
if get_option('with-sys-jpeg')
jpeg_dep = dependency('libjpeg')
libjpeg = []
jpeg_inc = []
else
jpeg_dep = empty_dep
subdir('libjpegd')
jpeg_inc = include_directories('libjpegd')
endif
if get_option('with-sys-png')
png_dep = dependency('libpng')
libpng = []
png_inc = []
else
png_dep = empty_dep
subdir('libpng')
png_inc = include_directories('libpng')
endif
xephem_data_dir = get_option('datadir') / 'xephem'
subdir('libastro')
subdir('libip')
subdir('liblilxml')
subdir('GUI/xephem')
executable('xephem', src,
dependencies: [motif_dep, xt_dep, x_dep, zlib_dep, \
jpeg_dep, png_dep, openssl_dep, m_dep],
include_directories: [inc_dirs, png_inc, zlib_inc, jpeg_inc],
link_with: [libastro, libip, liblilxml, libpng, libz, libjpeg],
install : true)
endif
run_target('cppcheck', command:['scripts/cppcheck.sh', '--project=' +
join_paths(meson.build_root(), 'compile_commands.json')])
conf_data = configuration_data()
conf_data.set('DATADIR', get_option('prefix') / xephem_data_dir)
configure_file(input: 'XEphem.in',
output : 'XEphem',
configuration: conf_data,
install_dir : get_option('sysconfdir') / 'X11/app-defaults/')

4
meson_options.txt Normal file
View File

@ -0,0 +1,4 @@
option('with-sys-zlib', type: 'boolean', value: true)
option('with-sys-png', type: 'boolean', value: true)
option('with-sys-jpeg', type: 'boolean', value: true)

3
scripts/cppcheck.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
cppcheck --enable=all --inline-suppr --suppress=missingIncludeSystem \
--cppcheck-build-dir=../build --inconclusive --library=posix $*

11
xephem.desktop Normal file
View File

@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.0
Exec=xephem
TryExec=xephem
Icon=XEphem
Terminal=false
Name=XEphem
GenericName=Astronomy program
Categories=Education;Science;Astronomy;
Type=Application
StartupNotify=false