mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
Make internal-only functions and structures private
Certain functions are intended to be internal only, but we currently export them anyway. This change moves them into a separate section of guestfs.h protected by a GUESTFS_PRIVATE variable. This change also enables private structs, but doesn't implement any. This change only affects the C api. Language bindings aren't affected, but probably should be in the future.
This commit is contained in:
committed by
Richard W.M. Jones
parent
1dd9bf73b7
commit
27b995c841
@@ -41,7 +41,7 @@ virt_alignment_scan_SOURCES = \
|
||||
|
||||
virt_alignment_scan_CFLAGS = \
|
||||
-DGUESTFS_WARN_DEPRECATED=1 \
|
||||
-DGUESTFS_PRIVATE_FUNCTIONS=1 \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src \
|
||||
-I$(top_srcdir)/fish \
|
||||
-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
|
||||
|
||||
@@ -44,7 +44,7 @@ virt_df_SOURCES = \
|
||||
|
||||
virt_df_CFLAGS = \
|
||||
-DGUESTFS_WARN_DEPRECATED=1 \
|
||||
-DGUESTFS_PRIVATE_FUNCTIONS=1 \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src \
|
||||
-I$(top_srcdir)/fish \
|
||||
-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
|
||||
|
||||
@@ -45,6 +45,7 @@ erl_guestfs_CFLAGS = \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src \
|
||||
-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
|
||||
-I$(ERLANG_LIB_DIR_erl_interface)/include \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
$(GPROF_CFLAGS) $(GCOV_CFLAGS)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ let defaults = { name = ""; style = RErr, [], []; proc_nr = None;
|
||||
tests = []; shortdesc = ""; longdesc = "";
|
||||
protocol_limit_warning = false; fish_alias = [];
|
||||
fish_output = None; in_fish = true; in_docs = true;
|
||||
deprecated_by = None; optional = None;
|
||||
internal = false; deprecated_by = None; optional = None;
|
||||
progress = false; camel_name = "";
|
||||
cancellable = false; config_only = false;
|
||||
once_had_no_optargs = false; blocking = true;
|
||||
@@ -76,7 +76,7 @@ let test_functions = [
|
||||
{ defaults with
|
||||
name = "internal_test";
|
||||
style = RErr, test_all_args, test_all_optargs;
|
||||
in_fish = false; in_docs = false; cancellable = true;
|
||||
in_fish = false; in_docs = false; internal = true; cancellable = true;
|
||||
blocking = false;
|
||||
shortdesc = "internal test function - do not use";
|
||||
longdesc = "\
|
||||
@@ -92,7 +92,7 @@ You probably don't want to call this function." };
|
||||
{ defaults with
|
||||
name = "internal_test_only_optargs";
|
||||
style = RErr, [], [OInt "test"];
|
||||
in_fish = false; in_docs = false; cancellable = true;
|
||||
in_fish = false; in_docs = false; internal = true; cancellable = true;
|
||||
blocking = false;
|
||||
shortdesc = "internal test function - do not use";
|
||||
longdesc = "\
|
||||
@@ -108,7 +108,7 @@ You probably don't want to call this function." };
|
||||
{ defaults with
|
||||
name = "internal_test_63_optargs";
|
||||
style = RErr, [], [OInt "opt1"; OInt "opt2"; OInt "opt3"; OInt "opt4"; OInt "opt5"; OInt "opt6"; OInt "opt7"; OInt "opt8"; OInt "opt9"; OInt "opt10"; OInt "opt11"; OInt "opt12"; OInt "opt13"; OInt "opt14"; OInt "opt15"; OInt "opt16"; OInt "opt17"; OInt "opt18"; OInt "opt19"; OInt "opt20"; OInt "opt21"; OInt "opt22"; OInt "opt23"; OInt "opt24"; OInt "opt25"; OInt "opt26"; OInt "opt27"; OInt "opt28"; OInt "opt29"; OInt "opt30"; OInt "opt31"; OInt "opt32"; OInt "opt33"; OInt "opt34"; OInt "opt35"; OInt "opt36"; OInt "opt37"; OInt "opt38"; OInt "opt39"; OInt "opt40"; OInt "opt41"; OInt "opt42"; OInt "opt43"; OInt "opt44"; OInt "opt45"; OInt "opt46"; OInt "opt47"; OInt "opt48"; OInt "opt49"; OInt "opt50"; OInt "opt51"; OInt "opt52"; OInt "opt53"; OInt "opt54"; OInt "opt55"; OInt "opt56"; OInt "opt57"; OInt "opt58"; OInt "opt59"; OInt "opt60"; OInt "opt61"; OInt "opt62"; OInt "opt63"];
|
||||
in_fish = false; in_docs = false; cancellable = true;
|
||||
in_fish = false; in_docs = false; internal = true; cancellable = true;
|
||||
blocking = false;
|
||||
shortdesc = "internal test function - do not use";
|
||||
longdesc = "\
|
||||
@@ -128,7 +128,7 @@ You probably don't want to call this function." }
|
||||
{ defaults with
|
||||
name = name;
|
||||
style = ret, [String "val"], [];
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
blocking = false;
|
||||
shortdesc = "internal test function - do not use";
|
||||
longdesc = "\
|
||||
@@ -142,7 +142,7 @@ You probably don't want to call this function." };
|
||||
{ defaults with
|
||||
name = name ^ "err";
|
||||
style = ret, [], [];
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
blocking = false;
|
||||
shortdesc = "internal test function - do not use";
|
||||
longdesc = "\
|
||||
@@ -166,7 +166,7 @@ let non_daemon_functions = test_functions @ [
|
||||
{ defaults with
|
||||
name = "internal_test_set_output";
|
||||
style = RErr, [String "filename"], [];
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
blocking = false;
|
||||
shortdesc = "internal test function - do not use";
|
||||
longdesc = "\
|
||||
@@ -181,7 +181,7 @@ You probably don't want to call this function." };
|
||||
{ defaults with
|
||||
name = "internal_test_close_output";
|
||||
style = RErr, [], [];
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
blocking = false;
|
||||
shortdesc = "internal test function - do not use";
|
||||
longdesc = "\
|
||||
@@ -6826,7 +6826,7 @@ yourself (Augeas support makes this relatively easy)." };
|
||||
name = "internal_lstatlist";
|
||||
style = RStructList ("statbufs", "stat"), [Pathname "path"; StringList "names"], [];
|
||||
proc_nr = Some 204;
|
||||
in_docs = false; in_fish = false;
|
||||
in_docs = false; in_fish = false; internal = true;
|
||||
shortdesc = "lstat on multiple files";
|
||||
longdesc = "\
|
||||
This call allows you to perform the C<guestfs_lstat> operation
|
||||
@@ -6850,7 +6850,7 @@ into smaller groups of names." };
|
||||
name = "internal_lxattrlist";
|
||||
style = RStructList ("xattrs", "xattr"), [Pathname "path"; StringList "names"], [];
|
||||
proc_nr = Some 205;
|
||||
in_docs = false; in_fish = false;
|
||||
in_docs = false; in_fish = false; internal = true;
|
||||
optional = Some "linuxxattrs";
|
||||
shortdesc = "lgetxattr on multiple files";
|
||||
longdesc = "\
|
||||
@@ -6880,7 +6880,7 @@ into smaller groups of names." };
|
||||
name = "internal_readlinklist";
|
||||
style = RStringList "links", [Pathname "path"; StringList "names"], [];
|
||||
proc_nr = Some 206;
|
||||
in_docs = false; in_fish = false;
|
||||
in_docs = false; in_fish = false; internal = true;
|
||||
shortdesc = "readlink on multiple files";
|
||||
longdesc = "\
|
||||
This call allows you to do a C<readlink> operation
|
||||
@@ -7678,7 +7678,7 @@ to ensure the length of the file is exactly C<len> bytes." };
|
||||
name = "internal_write";
|
||||
style = RErr, [Pathname "path"; BufferIn "content"], [];
|
||||
proc_nr = Some 246;
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
protocol_limit_warning = true;
|
||||
tests = [
|
||||
InitScratchFS, Always, TestOutput (
|
||||
@@ -8394,7 +8394,7 @@ See also L<guestfs(3)/RESIZE2FS ERRORS>." };
|
||||
name = "internal_autosync";
|
||||
style = RErr, [], [];
|
||||
proc_nr = Some 282;
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
shortdesc = "internal autosync operation";
|
||||
longdesc = "\
|
||||
This command performs the autosync operation just before the
|
||||
@@ -8540,7 +8540,7 @@ See also L<btrfs(8)>." };
|
||||
name = "internal_write_append";
|
||||
style = RErr, [Pathname "path"; BufferIn "content"], [];
|
||||
proc_nr = Some 290;
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
protocol_limit_warning = true;
|
||||
tests = [
|
||||
InitScratchFS, Always, TestOutput (
|
||||
@@ -10302,7 +10302,7 @@ are the full raw block device and partition names
|
||||
name = "internal_hot_add_drive";
|
||||
style = RErr, [String "label"], [];
|
||||
proc_nr = Some 370;
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
tests = [];
|
||||
shortdesc = "internal hotplugging operation";
|
||||
longdesc = "\
|
||||
@@ -10312,7 +10312,7 @@ This function is used internally when hotplugging drives." };
|
||||
name = "internal_hot_remove_drive_precheck";
|
||||
style = RErr, [String "label"], [];
|
||||
proc_nr = Some 371;
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
tests = [];
|
||||
shortdesc = "internal hotplugging operation";
|
||||
longdesc = "\
|
||||
@@ -10322,7 +10322,7 @@ This function is used internally when hotplugging drives." };
|
||||
name = "internal_hot_remove_drive";
|
||||
style = RErr, [String "label"], [];
|
||||
proc_nr = Some 372;
|
||||
in_fish = false; in_docs = false;
|
||||
in_fish = false; in_docs = false; internal = true;
|
||||
tests = [];
|
||||
shortdesc = "internal hotplugging operation";
|
||||
longdesc = "\
|
||||
@@ -11054,11 +11054,23 @@ let non_daemon_functions, daemon_functions =
|
||||
(* All functions. *)
|
||||
let all_functions = non_daemon_functions @ daemon_functions
|
||||
|
||||
let external_functions =
|
||||
List.filter (fun x -> not x.internal) all_functions
|
||||
|
||||
let internal_functions =
|
||||
List.filter (fun x -> x.internal) all_functions
|
||||
|
||||
(* In some places we want the functions to be displayed sorted
|
||||
* alphabetically, so this is useful:
|
||||
*)
|
||||
let all_functions_sorted = List.sort action_compare all_functions
|
||||
|
||||
let external_functions_sorted =
|
||||
List.sort action_compare external_functions
|
||||
|
||||
let internal_functions_sorted =
|
||||
List.sort action_compare internal_functions
|
||||
|
||||
(* This is used to generate the src/MAX_PROC_NR file which
|
||||
* contains the maximum procedure number, a surrogate for the
|
||||
* ABI version number. See src/Makefile.am for the details.
|
||||
|
||||
@@ -29,9 +29,21 @@ val daemon_functions : Types.action list
|
||||
val all_functions : Types.action list
|
||||
(** Concatenation of [non_daemon_functions] and [daemon_functions] lists. *)
|
||||
|
||||
val external_functions : Types.action list
|
||||
(** [all_functions] filtered for external functions **)
|
||||
|
||||
val internal_functions : Types.action list
|
||||
(** [all_functions] filtered for internal functions **)
|
||||
|
||||
val all_functions_sorted : Types.action list
|
||||
(** [all_functions] but sorted by name. *)
|
||||
|
||||
val external_functions_sorted : Types.action list
|
||||
(** [external_functions] but sorted by name. *)
|
||||
|
||||
val internal_functions_sorted : Types.action list
|
||||
(** [internal_functions] but sorted by name. *)
|
||||
|
||||
val test_functions : Types.action list
|
||||
(** Internal test functions used to test the language bindings. *)
|
||||
|
||||
|
||||
@@ -566,7 +566,7 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char *
|
||||
*)
|
||||
|
||||
(* Public structures. *)
|
||||
List.iter (
|
||||
let generate_all_structs = List.iter (
|
||||
fun { s_name = typ; s_cols = cols } ->
|
||||
pr "struct guestfs_%s {\n" typ;
|
||||
List.iter (
|
||||
@@ -593,7 +593,9 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char *
|
||||
pr "extern GUESTFS_DLL_PUBLIC void guestfs_free_%s (struct guestfs_%s *);\n" typ typ;
|
||||
pr "extern GUESTFS_DLL_PUBLIC void guestfs_free_%s_list (struct guestfs_%s_list *);\n" typ typ;
|
||||
pr "\n"
|
||||
) structs;
|
||||
) in
|
||||
|
||||
generate_all_structs external_structs;
|
||||
|
||||
pr "\
|
||||
/* Actions. */
|
||||
@@ -663,7 +665,7 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char *
|
||||
pr "\n"
|
||||
in
|
||||
|
||||
List.iter (
|
||||
let generate_all_headers = List.iter (
|
||||
fun ({ name = name; style = ret, args, _ } as f) ->
|
||||
(* If once_had_no_optargs is set, then we need to generate a
|
||||
* <name>_opts variant, plus a backwards-compatible wrapper
|
||||
@@ -675,18 +677,19 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char *
|
||||
)
|
||||
else
|
||||
generate_action_header f
|
||||
) all_functions_sorted;
|
||||
) in
|
||||
|
||||
generate_all_headers external_functions_sorted;
|
||||
|
||||
pr "\
|
||||
#if GUESTFS_PRIVATE_FUNCTIONS
|
||||
|
||||
/* Private functions.
|
||||
*
|
||||
* These are NOT part of the public, stable API, and can change at any
|
||||
* time! We export them because they are used by some of the language
|
||||
* bindings.
|
||||
#if GUESTFS_PRIVATE
|
||||
/* Symbols protected by GUESTFS_PRIVATE are NOT part of the public,
|
||||
* stable API, and can change at any time! We export them because
|
||||
* they are used by some of the language bindings.
|
||||
*/
|
||||
|
||||
/* Private functions. */
|
||||
|
||||
extern GUESTFS_DLL_PUBLIC void *guestfs___safe_malloc (guestfs_h *g, size_t nbytes);
|
||||
extern GUESTFS_DLL_PUBLIC void *guestfs___safe_calloc (guestfs_h *g, size_t n, size_t s);
|
||||
extern GUESTFS_DLL_PUBLIC char *guestfs___safe_strdup (guestfs_h *g, const char *str);
|
||||
@@ -694,7 +697,30 @@ extern GUESTFS_DLL_PUBLIC void *guestfs___safe_memdup (guestfs_h *g, const void
|
||||
|
||||
extern GUESTFS_DLL_PUBLIC int guestfs___for_each_disk (guestfs_h *g, /* virDomainPtr */ void *dom, int (*)(guestfs_h *g, const char *filename, const char *format, int readonly, void *data), void *data);
|
||||
|
||||
#endif /* End of private functions. */
|
||||
";
|
||||
|
||||
generate_all_headers internal_functions_sorted;
|
||||
|
||||
pr "\
|
||||
/* Private structures. */
|
||||
|
||||
";
|
||||
|
||||
generate_all_structs internal_structs;
|
||||
|
||||
pr "\
|
||||
/* Deprecated macros for internal functions. */
|
||||
|
||||
";
|
||||
|
||||
List.iter (
|
||||
fun { name = shortname } ->
|
||||
pr "#define LIBGUESTFS_HAVE_%s 1\n" (String.uppercase shortname);
|
||||
) internal_functions_sorted;
|
||||
|
||||
pr "\
|
||||
|
||||
#endif /* End of GUESTFS_PRIVATE. */
|
||||
|
||||
/* Deprecated macros. Use GUESTFS_HAVE_* instead. */
|
||||
|
||||
@@ -717,7 +743,7 @@ extern GUESTFS_DLL_PUBLIC int guestfs___for_each_disk (guestfs_h *g, /* virDomai
|
||||
List.iter (
|
||||
fun { name = shortname } ->
|
||||
pr "#define LIBGUESTFS_HAVE_%s 1\n" (String.uppercase shortname);
|
||||
) all_functions_sorted;
|
||||
) external_functions_sorted;
|
||||
|
||||
pr "
|
||||
/* End of deprecated macros. */
|
||||
|
||||
@@ -270,7 +270,7 @@ extern void free_strings (char **r);
|
||||
pr " return erl_mk_list (t, %d);\n" (List.length cols);
|
||||
pr "}\n";
|
||||
pr "\n";
|
||||
) structs;
|
||||
) external_structs;
|
||||
|
||||
(* Emit a copy_TYPE_list function definition only if that function is used. *)
|
||||
List.iter (
|
||||
|
||||
@@ -279,7 +279,7 @@ Guestfish will prompt for these separately."
|
||||
) cols;
|
||||
pr "}\n";
|
||||
pr "\n";
|
||||
) structs;
|
||||
) external_structs;
|
||||
|
||||
(* Emit a print_TYPE_list function definition only if that function is used. *)
|
||||
List.iter (
|
||||
|
||||
@@ -107,7 +107,7 @@ let filenames =
|
||||
"session" :: "tristate" ::
|
||||
|
||||
(* structs *)
|
||||
List.map (fun { s_name = typ } -> "struct-" ^ typ) structs @
|
||||
List.map (fun { s_name = typ } -> "struct-" ^ typ) external_structs @
|
||||
|
||||
(* optargs *)
|
||||
List.map (function { name = name } -> "optargs-" ^ name) (
|
||||
|
||||
@@ -170,7 +170,7 @@ Run it from the top source directory using the command
|
||||
output_to filename (generate_gobject_struct_header short typ cols);
|
||||
let filename = sprintf "gobject/src/%s.c" short in
|
||||
output_to filename (generate_gobject_struct_source short typ cols)
|
||||
) structs;
|
||||
) external_structs;
|
||||
delete_except_generated "gobject/include/guestfs-gobject/struct-*.h";
|
||||
delete_except_generated "gobject/src/struct-*.c";
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ copy_table (char * const * argv)
|
||||
pr " CAMLreturn (rv);\n";
|
||||
pr "}\n";
|
||||
pr "\n";
|
||||
) structs;
|
||||
) external_structs;
|
||||
|
||||
(* Emit a copy_TYPE_list function definition only if that function is used. *)
|
||||
List.iter (
|
||||
@@ -686,7 +686,7 @@ and generate_ocaml_structure_decls () =
|
||||
) cols;
|
||||
pr "}\n";
|
||||
pr "\n"
|
||||
) structs
|
||||
) external_structs
|
||||
|
||||
and generate_ocaml_prototype ?(is_external = false) name style =
|
||||
if is_external then pr "external " else pr "val ";
|
||||
|
||||
@@ -240,7 +240,7 @@ free_strings (char **argv)
|
||||
pr "};\n";
|
||||
pr "\n";
|
||||
|
||||
) structs;
|
||||
) external_structs;
|
||||
|
||||
(* Emit a put_TYPE_list function definition only if that function is used. *)
|
||||
List.iter (
|
||||
|
||||
@@ -26,6 +26,7 @@ type struc = {
|
||||
s_name : string;
|
||||
s_cols : cols;
|
||||
s_camel_name : string;
|
||||
s_internal : bool;
|
||||
s_unused : unit; (* Silences warning 23 when using 'defaults with ...' *)
|
||||
}
|
||||
|
||||
@@ -94,7 +95,8 @@ let lvm_lv_cols = [
|
||||
"modules", FString;
|
||||
]
|
||||
|
||||
let defaults = { s_name = ""; s_cols = []; s_camel_name = ""; s_unused = () }
|
||||
let defaults = { s_name = ""; s_cols = []; s_camel_name = "";
|
||||
s_internal = false; s_unused = () }
|
||||
|
||||
(* Names and fields in all structures (in RStruct and RStructList)
|
||||
* that we support.
|
||||
@@ -369,3 +371,7 @@ let lookup_struct name =
|
||||
let camel_name_of_struct name = (lookup_struct name).s_camel_name
|
||||
|
||||
let cols_of_struct name = (lookup_struct name).s_cols
|
||||
|
||||
let external_structs = List.filter (fun x -> not x.s_internal) structs
|
||||
|
||||
let internal_structs = List.filter (fun x -> x.s_internal) structs
|
||||
|
||||
@@ -27,6 +27,7 @@ type struc = {
|
||||
s_name : string; (** Regular name. *)
|
||||
s_cols : cols; (** Columns. *)
|
||||
s_camel_name : string; (** Camel-cased name. *)
|
||||
s_internal : bool; (** Internal only. *)
|
||||
s_unused : unit;
|
||||
}
|
||||
|
||||
@@ -48,3 +49,9 @@ val camel_name_of_struct : string -> string
|
||||
|
||||
val cols_of_struct : string -> cols
|
||||
(** Lookup struct by name, return the s_cols field. *)
|
||||
|
||||
val external_structs : struc list
|
||||
(** Only external structs *)
|
||||
|
||||
val internal_structs : struc list
|
||||
(** Only internal structs *)
|
||||
|
||||
@@ -383,6 +383,8 @@ type action = {
|
||||
fish_output : fish_output_t option; (* how to display output in guestfish *)
|
||||
in_fish : bool; (* export via guestfish *)
|
||||
in_docs : bool; (* add this function to documentation *)
|
||||
internal: bool; (* function is not part of the
|
||||
external api *)
|
||||
deprecated_by : string option; (* function is deprecated, use .. instead *)
|
||||
optional : string option; (* function is part of an optional group *)
|
||||
progress : bool; (* function can generate progress messages *)
|
||||
|
||||
@@ -52,6 +52,7 @@ libguestfs_gobject_1_0_ladir = $(includedir)/guestfs-gobject
|
||||
libguestfs_gobject_1_0_la_HEADERS = $(guestfs_gobject_headers)
|
||||
libguestfs_gobject_1_0_la_SOURCES = $(guestfs_gobject_sources)
|
||||
libguestfs_gobject_1_0_la_CFLAGS = -I$(top_srcdir)/src -I$(srcdir)/include \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
$(GOBJECT_CFLAGS)
|
||||
libguestfs_gobject_1_0_la_LIBS = $(GOBJECT_LIBS)
|
||||
libguestfs_gobject_1_0_la_LDFLAGS = $(LDFLAGS) -L$(top_builddir)/src
|
||||
|
||||
@@ -79,7 +79,7 @@ libguestfs_jni_la_SOURCES = \
|
||||
libguestfs_jni_la_LIBADD = $(top_builddir)/src/libguestfs.la
|
||||
libguestfs_jni_la_LDFLAGS = -version-info $(JNI_VERSION_INFO) -shared
|
||||
libguestfs_jni_la_CFLAGS = \
|
||||
-DGUESTFS_PRIVATE_FUNCTIONS=1 \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src \
|
||||
$(JNI_CFLAGS)
|
||||
|
||||
@@ -41,6 +41,7 @@ libluaguestfs_la_SOURCES = lua-guestfs.c
|
||||
libluaguestfs_la_CFLAGS = \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
$(LUA_CFLAGS)
|
||||
libluaguestfs_la_LIBADD = $(top_builddir)/src/libguestfs.la
|
||||
libluaguestfs_la_LDFLAGS = -avoid-version -shared
|
||||
|
||||
@@ -64,7 +64,7 @@ mlguestfs.cmxa: libguestfsocaml.a guestfs.cmx
|
||||
-L$(top_builddir)/src/.libs -lguestfs
|
||||
|
||||
libguestfsocaml_a_CFLAGS = \
|
||||
-DGUESTFS_PRIVATE_FUNCTIONS=1 \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
-I$(top_builddir) -I$(OCAMLLIB) -I$(top_srcdir)/ocaml \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
|
||||
@@ -27,5 +27,5 @@ WriteMakefile (
|
||||
LIBS => '-L@top_builddir@/src/.libs -lguestfs',
|
||||
INC => '-I@top_builddir@/src -I@top_srcdir@/src',
|
||||
TYPEMAPS => [ '@srcdir@/typemap' ],
|
||||
CCFLAGS => $Config{ccflags} . ' -DGUESTFS_PRIVATE_FUNCTIONS=1 @CFLAGS@',
|
||||
CCFLAGS => $Config{ccflags} . ' -DGUESTFS_PRIVATE=1 @CFLAGS@',
|
||||
);
|
||||
|
||||
@@ -43,6 +43,7 @@ all: extension/config.h
|
||||
$(MAKE) -C extension \
|
||||
EXTRA_INCLUDES="-I$(abs_srcdir)/../src" \
|
||||
EXTRA_LDFLAGS="-L$(abs_srcdir)/../src/.libs -lguestfs" \
|
||||
EXTRA_CFLAGS="-DGUESTFS_PRIVATE=1" \
|
||||
all
|
||||
|
||||
extension/config.h: extension/config.m4 ../config.status
|
||||
|
||||
@@ -41,7 +41,7 @@ python_LTLIBRARIES = libguestfsmod.la
|
||||
|
||||
libguestfsmod_la_SOURCES = guestfs-py.c guestfs-py.h guestfs-py-byhand.c
|
||||
libguestfsmod_la_CFLAGS = \
|
||||
-DGUESTFS_PRIVATE_FUNCTIONS=1 \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
-I$(PYTHON_INCLUDEDIR) \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src
|
||||
|
||||
@@ -30,7 +30,7 @@ unless have_library("guestfs", "guestfs_create", "guestfs.h")
|
||||
end
|
||||
|
||||
$CFLAGS =
|
||||
"#{$CFLAGS} @CFLAGS@ -DGUESTFS_PRIVATE_FUNCTIONS=1 " <<
|
||||
"#{$CFLAGS} @CFLAGS@ -DGUESTFS_PRIVATE=1 " <<
|
||||
"@WARN_CFLAGS@ @WERROR_CFLAGS@"
|
||||
|
||||
create_header
|
||||
|
||||
@@ -195,7 +195,7 @@ libguestfs_la_LIBADD += liberrnostring.la libprotocol.la
|
||||
libguestfs_la_CFLAGS = \
|
||||
-DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"' \
|
||||
-DGUESTFS_WARN_DEPRECATED=1 \
|
||||
-DGUESTFS_PRIVATE_FUNCTIONS=1 \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
-DLIBOSINFO_DB_PATH='"$(datadir)/libosinfo/db"' \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
$(GPROF_CFLAGS) $(GCOV_CFLAGS) \
|
||||
|
||||
@@ -72,6 +72,7 @@ TESTS_ENVIRONMENT = \
|
||||
tests_SOURCES = tests.c
|
||||
tests_CFLAGS = \
|
||||
-I$(top_srcdir)/src -I$(top_builddir)/src \
|
||||
-DGUESTFS_PRIVATE=1 \
|
||||
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
|
||||
$(GPROF_CFLAGS) $(GCOV_CFLAGS)
|
||||
tests_LDADD = $(top_builddir)/src/libguestfs.la
|
||||
|
||||
Reference in New Issue
Block a user