]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #5842 from keszybz/meson-status-and-conditionals
authorMichael Biebl <mbiebl@gmail.com>
Wed, 3 May 2017 14:45:31 +0000 (16:45 +0200)
committerGitHub <noreply@github.com>
Wed, 3 May 2017 14:45:31 +0000 (16:45 +0200)
Meson status and conditional simplification

1  2 
man/meson.build
src/network/meson.build
src/shared/meson.build

diff --combined man/meson.build
index 73a9eb45f6952c6355c197f1a7680b1bfe57cf22,6f7b1e879313c64baef5622ac9a0adf19096d001..4f2ddad31a8d9f600bae2ba1b1ef5b7ee11645bb
@@@ -50,7 -50,7 +50,7 @@@ foreach tuple : manpage
  
          mandirn = join_paths(get_option('mandir'), 'man' + section)
  
-         if condition == '' or conf.get(condition, 0) == 1
+         if condition == '' or conf.get(condition, false)
                  p1 = custom_target(
                          man,
                          input : xml,
                          install_dir : mandirn)
                  man_pages += [p1]
  
 -                p2 = custom_target(
 +                p2 = []
 +                foreach htmlalias : htmlaliases
 +                        link = custom_target(
 +                                htmlalias,
 +                                input : p2,
 +                                output : htmlalias,
 +                                command : ['ln', '-fs', html, '@OUTPUT@'])
 +                        if want_html
 +                                dst = join_paths(docdir, 'html', htmlalias)
 +                                cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
 +                                meson.add_install_script('sh', '-c', cmd)
 +                                p2 += [link]
 +                        endif
 +                        html_pages += [link]
 +                endforeach
 +
 +                p3 = custom_target(
                          html,
                          input : xml,
 -                        output : [html] + htmlaliases,
 +                        output : html,
                          command : xslt_cmd + [custom_html_xsl, '@INPUT@'],
                          depend_files : custom_entities_ent,
 +                        depends : p2,
                          install : want_html,
                          install_dir : join_paths(docdir, 'html'))
 -                html_pages += [p2]
 +                html_pages += [p3]
  
                  source_xml_files += files(tuple[0] + '.xml')
          else
@@@ -134,33 -117,14 +134,33 @@@ foreach tuple : [['systemd.directives'
                  install_dir : mandirn)
          man_pages += [p1]
  
 -        p2 = custom_target(
 +        p2 = []
 +        if html == 'systemd.index.html'
 +                htmlalias = 'index.html'
 +                link = custom_target(
 +                        htmlalias,
 +                        input : p2,
 +                        output : htmlalias,
 +                        command : ['ln', '-fs', html, '@OUTPUT@'])
 +                if want_html
 +                        dst = join_paths(docdir, 'html', htmlalias)
 +                        cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
 +                        meson.add_install_script('sh', '-c', cmd)
 +                        p2 += [link]
 +                endif
 +                html_pages += [link]
 +        endif
 +
 +        p3 = custom_target(
                  html,
                  input : xml,
                  output : html,
                  command : xslt_cmd + [custom_html_xsl, '@INPUT@'],
 +                depend_files : custom_entities_ent,
 +                depends : p2,
                  install : want_html and have_lxml,
                  install_dir : join_paths(docdir, 'html'))
 -        html_pages += [p2]
 +        html_pages += [p3]
  endforeach
  
  # cannot use run_target until https://github.com/mesonbuild/meson/issues/1644 is resolved
diff --combined src/network/meson.build
index 808f9eebbc26ed8e80fd3b5b6fe2f4d9ca60be8f,ebd4e62eb30b7ddb3a7e74f824d6ff5fdb16bdbe..5f97cc197b97e049344ff167613b43dd16e775ed
@@@ -27,8 -27,6 +27,8 @@@ sources = files(''
          netdev/vxlan.h
          netdev/geneve.c
          netdev/geneve.h
 +        networkd-address-label.c
 +        networkd-address-label.h
          networkd-address-pool.c
          networkd-address-pool.h
          networkd-address.c
@@@ -77,7 -75,7 +77,7 @@@ networkctl_sources = files('networkctl.
  
  network_include_dir = include_directories('.')
  
- if conf.get('ENABLE_NETWORKD', 0) == 1
+ if conf.get('ENABLE_NETWORKD', false)
          networkd_gperf_c = custom_target(
                  'networkd-gperf.c',
                  input : 'networkd-gperf.gperf',
diff --combined src/shared/meson.build
index f1d73d1b3ff6a85ff006fefd29c3d7b014d47a3b,49a7d9f30b6bbcf422358631e04aee73eda190bd..b684e5b5436fbc6ed49671f4f569c9c73288f216
@@@ -103,19 -103,19 +103,19 @@@ shared_sources = ''
  test_tables_h = files('test-tables.h')
  shared_sources += [test_tables_h]
  
- if conf.get('HAVE_ACL', 0) == 1
+ if conf.get('HAVE_ACL', false)
          shared_sources += ['acl-util.c']
  endif
  
- if conf.get('HAVE_UTMP', 0) == 1
+ if conf.get('HAVE_UTMP', false)
          shared_sources += ['utmp-wtmp.c']
  endif
  
- if conf.get('HAVE_SECCOMP', 0) == 1
+ if conf.get('HAVE_SECCOMP', false)
          shared_sources += ['seccomp-util.c']
  endif
  
- if conf.get('HAVE_LIBIPTC', 0) == 1
+ if conf.get('HAVE_LIBIPTC', false)
          shared_sources += ['firewall-util.c']
  endif
  
@@@ -127,10 -127,10 +127,10 @@@ libshared = shared_library
          basic_sources,
          journal_internal_sources,
          libsystemd_internal_sources,
 +        libudev_sources,
          include_directories : includes,
          link_args : ['-shared'],
          c_args : ['-fvisibility=default'],
 -        link_with : [libudev],
          dependencies : [threads,
                          librt,
                          libcap,