wafsamba: Only install .pc files if libraries are public.
[samba.git] / buildtools / wafsamba / wafsamba.py
index 3858770a6fc916d50808cb96fb16d62bdc9f547d..338bc3d48b35375c38fb2eb3751bb50062e155fa 100644 (file)
@@ -191,13 +191,22 @@ def SAMBA_LIBRARY(bld, libname, source,
     link_name = bld.map_shlib_extension(link_name, python=(target_type=='PYTHON'))
 
     # we don't want any public libraries without version numbers
-    if not private_library and vnum is None and soname is None and target_type != 'PYTHON' and not realname:
-        raise Utils.WafError("public library '%s' must have a vnum" % libname)
+    if (not private_library and target_type != 'PYTHON' and not realname):
+        if vnum is None and soname is None:
+            raise Utils.WafError("public library '%s' must have a vnum" %
+                    libname)
+        if pc_files is None:
+            raise Utils.WafError("public library '%s' must have pkg-config file" %
+                       libname)
+        if public_headers is None:
+            raise Utils.WafError("public library '%s' must have header files" %
+                       libname)
 
     if target_type == 'PYTHON' or realname or not private_library:
         bundled_name = libname.replace('_', '-')
     else:
-        bundled_name = PRIVATE_NAME(bld, libname, bundled_extension, private_library)
+        bundled_name = PRIVATE_NAME(bld, libname, bundled_extension,
+            private_library)
 
     ldflags = TO_LIST(ldflags)
 
@@ -270,10 +279,11 @@ def SAMBA_LIBRARY(bld, libname, source,
     if link_name:
         t.link_name = link_name
 
-    if pc_files is not None:
+    if pc_files is not None and not private_library:
         bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
 
-    if manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and bld.env['XSLTPROC_MANPAGES']:
+    if (manpages is not None and 'XSLTPROC_MANPAGES' in bld.env and 
+        bld.env['XSLTPROC_MANPAGES']):
         bld.MANPAGES(manpages)