Commit 134dcefe4303fd97a85041d9777a49b640ed4439
1 parent
0843a5ee
do not append empty libraries or directories
Showing
1 changed file
with
20 additions
and
16 deletions
pyext/setup.py.in
| ... | ... | @@ -9,37 +9,41 @@ libraries = ['gamma'] |
| 9 | 9 | |
| 10 | 10 | # Add cfitsio library only if available |
| 11 | 11 | if '@WITH_CFITSIO_TRUE@' != '#': |
| 12 | - print "Link cfitsio into Python bindings." | |
| 13 | - libraries.append('cfitsio') | |
| 12 | + print "Link cfitsio into Python bindings." | |
| 13 | + libraries.append('cfitsio') | |
| 14 | 14 | |
| 15 | 15 | # Add readline library only if available |
| 16 | -if '@HAVE_LIBREADLINE@' != '#': | |
| 17 | - print "Link readline into Python bindings." | |
| 18 | - libraries.append('readline') | |
| 16 | +if '@WITH_READLINE_TRUE@' != '#': | |
| 17 | + print "Link readline into Python bindings." | |
| 18 | + libraries.append('readline') | |
| 19 | + libraries.append('ncurses') | |
| 19 | 20 | |
| 20 | 21 | # Add extra libraries |
| 21 | 22 | extra_libs = ('@PYTHON_EXTRA_LIBS@').split(',') |
| 22 | 23 | for extra_lib in extra_libs: |
| 23 | - libraries.append(extra_lib) | |
| 24 | + if len(extra_lib) > 0: | |
| 25 | + libraries.append(extra_lib) | |
| 24 | 26 | |
| 25 | 27 | # Get extra library paths |
| 26 | 28 | extra_lib_paths = ('@LDFLAGS@').split(' ') |
| 27 | 29 | for extra_lib_path in extra_lib_paths: |
| 28 | - libdirs.append(extra_lib_path.lstrip('-L')) | |
| 30 | + dir = extra_lib_path.lstrip('-L') | |
| 31 | + if len(dir) > 0: | |
| 32 | + libdirs.append(extra_lib_path.lstrip('-L')) | |
| 29 | 33 | |
| 30 | 34 | # Add instrument specific include directories and data files |
| 31 | 35 | if '@WITH_INST_MWL_TRUE@' != '#': |
| 32 | - print "Include multi-wavelength interface in gammalib Python bindings." | |
| 33 | - include_dirs.append('@top_srcdir@/inst/mwl/include') | |
| 34 | - data_files.extend(glob.glob('@top_srcdir@/inst/mwl/pyext/*.i')) | |
| 36 | + print "Include multi-wavelength interface in gammalib Python bindings." | |
| 37 | + include_dirs.append('@top_srcdir@/inst/mwl/include') | |
| 38 | + data_files.extend(glob.glob('@top_srcdir@/inst/mwl/pyext/*.i')) | |
| 35 | 39 | if '@WITH_INST_CTA_TRUE@' != '#': |
| 36 | - print "Include CTA instrument interface in gammalib Python bindings." | |
| 37 | - include_dirs.append('@top_srcdir@/inst/cta/include') | |
| 38 | - data_files.extend(glob.glob('@top_srcdir@/inst/cta/pyext/*.i')) | |
| 40 | + print "Include CTA instrument interface in gammalib Python bindings." | |
| 41 | + include_dirs.append('@top_srcdir@/inst/cta/include') | |
| 42 | + data_files.extend(glob.glob('@top_srcdir@/inst/cta/pyext/*.i')) | |
| 39 | 43 | if '@WITH_INST_LAT_TRUE@' != '#': |
| 40 | - print "Include Fermi/LAT instrument interface in gammalib Python bindings." | |
| 41 | - include_dirs.append('@top_srcdir@/inst/lat/include') | |
| 42 | - data_files.extend(glob.glob('@top_srcdir@/inst/lat/pyext/*.i')) | |
| 44 | + print "Include Fermi/LAT instrument interface in gammalib Python bindings." | |
| 45 | + include_dirs.append('@top_srcdir@/inst/lat/include') | |
| 46 | + data_files.extend(glob.glob('@top_srcdir@/inst/lat/pyext/*.i')) | |
| 43 | 47 | |
| 44 | 48 | # Setup |
| 45 | 49 | setup(name='@PACKAGE_NAME@', | ... | ... |