forked from osmocom/wireshark
make-dissectors-reg: optimize by factoring out the loops
Instead of calling the grep/sed pipelines for each file, build the list of files in the beginning and call each pipeline only once, passing the list to the first grep. This results in a massive speedup in Cygwin; in my test, the time it takes to run make-dissector-reg . dissectors packet-*.c in dissectors/epan is reduced from ~116 to ~3 seconds. I also tried it on NetBSD, where the time do to the same goes from ~6 to ~0.5 seconds. Amend makefile comments to elide mentions of invoking multiple processes per file. Change-Id: Iad441e7d2b6cc3669dada57646e2f8f6b987fd34 Reviewed-on: https://code.wireshark.org/review/2826 Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
3490bc6eb9
commit
afa8f21f56
|
@ -86,11 +86,11 @@ x11-dissector: $(top_srcdir)/tools/process-x11-fields.pl x11-fields $(top_srcdir
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the register.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "dissectors", to indicate that we should build
|
||||
|
|
|
@ -65,11 +65,11 @@ packet-rrc.obj : packet-rrc.c
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the register.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "dissectors", to indicate that we should build
|
||||
|
|
|
@ -70,11 +70,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -70,11 +70,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -70,11 +70,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -72,11 +72,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -70,11 +70,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -70,11 +70,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -77,11 +77,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -70,11 +70,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -71,11 +71,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -70,11 +70,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -71,11 +71,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -70,11 +70,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -73,11 +73,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -68,11 +68,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -70,11 +70,11 @@ LIBS =
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -64,11 +64,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU
|
|||
# pass only the first few names in the list to the shell, for some
|
||||
# reason.
|
||||
#
|
||||
# Therefore, we have a script to generate the plugin.c file.
|
||||
# The shell script runs slowly, as multiple greps and seds are run
|
||||
# for each input file; this is especially slow on Windows. Therefore,
|
||||
# if Python is present (as indicated by PYTHON being defined), we run
|
||||
# a faster Python script to do that work instead.
|
||||
# Therefore, we use a script to generate the register.c file.
|
||||
# There are two versions of the script, a shell and a Python version.
|
||||
# The Python script runs faster, since it uses caching to speed up
|
||||
# repeated runs and doesn't invoke external processes, so we prefer
|
||||
# that if Python is available.
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
# The second argument is "plugin", to indicate that we should build
|
||||
|
|
|
@ -27,6 +27,22 @@ fi
|
|||
#
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
files=''
|
||||
|
||||
for f in "$@"
|
||||
do
|
||||
# This won't work if any filenames contain spaces.
|
||||
# However, this script is called by make, which doesn't support
|
||||
# spaces either.
|
||||
if [ -f "$f" ]
|
||||
then
|
||||
files="$files $f"
|
||||
else
|
||||
files="$files $srcdir/$f"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
rm -f ${outfile}-tmp
|
||||
echo '/* Do not modify this file. */' >${outfile}-tmp
|
||||
echo '/* It is created automatically by the Makefile. */'>>${outfile}-tmp
|
||||
|
@ -54,26 +70,11 @@ EOF
|
|||
#
|
||||
# Build code to call all the protocol registration routines.
|
||||
#
|
||||
for f in "$@"
|
||||
do
|
||||
if [ -f $f ]
|
||||
then
|
||||
srcfile=$f
|
||||
else
|
||||
srcfile=$srcdir/$f
|
||||
fi
|
||||
grep '^proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
|
||||
done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
|
||||
for f in "$@"
|
||||
do
|
||||
if [ -f $f ]
|
||||
then
|
||||
srcfile=$f
|
||||
else
|
||||
srcfile=$srcdir/$f
|
||||
fi
|
||||
grep '^void proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
|
||||
done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
|
||||
grep '^proto_register_[a-z_0-9A-Z]* *(' $files 2>/dev/null | grep -v ';' \
|
||||
| sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
|
||||
|
||||
grep '^void proto_register_[a-z_0-9A-Z]* *(' $files 2>/dev/null | grep -v ';' \
|
||||
| sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
|
||||
else
|
||||
cat <<"EOF" >>${outfile}-tmp
|
||||
#include "register.h"
|
||||
|
@ -84,26 +85,11 @@ EOF
|
|||
#
|
||||
# Build code to call all the protocol registration routines.
|
||||
#
|
||||
for f in "$@"
|
||||
do
|
||||
if [ -f $f ]
|
||||
then
|
||||
srcfile=$f
|
||||
else
|
||||
srcfile=$srcdir/$f
|
||||
fi
|
||||
grep '^proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
|
||||
done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); if(cb) (*cb)(RA_REGISTER, \"\1\", client_data); \1 ();}/' >>${outfile}-tmp
|
||||
for f in "$@"
|
||||
do
|
||||
if [ -f $f ]
|
||||
then
|
||||
srcfile=$f
|
||||
else
|
||||
srcfile=$srcdir/$f
|
||||
fi
|
||||
grep '^void proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
|
||||
done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); if(cb) (*cb)(RA_REGISTER, \"\1\", client_data); \1 ();}/' >>${outfile}-tmp
|
||||
grep '^proto_register_[a-z_0-9A-Z]* *(' $files 2>/dev/null | grep -v ';' \
|
||||
| sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); if(cb) (*cb)(RA_REGISTER, \"\1\", client_data); \1 ();}/' >>${outfile}-tmp
|
||||
|
||||
grep '^void proto_register_[a-z_0-9A-Z]* *(' $files 2>/dev/null | grep -v ';' \
|
||||
| sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); if(cb) (*cb)(RA_REGISTER, \"\1\", client_data); \1 ();}/' >>${outfile}-tmp
|
||||
|
||||
fi
|
||||
echo '}' >>${outfile}-tmp
|
||||
|
@ -119,52 +105,22 @@ WS_DLL_PUBLIC_DEF void
|
|||
plugin_reg_handoff(void)
|
||||
{
|
||||
EOF
|
||||
for f in "$@"
|
||||
do
|
||||
if [ -f $f ]
|
||||
then
|
||||
srcfile=$f
|
||||
else
|
||||
srcfile=$srcdir/$f
|
||||
fi
|
||||
grep '^proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
|
||||
done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
|
||||
for f in "$@"
|
||||
do
|
||||
if [ -f $f ]
|
||||
then
|
||||
srcfile=$f
|
||||
else
|
||||
srcfile=$srcdir/$f
|
||||
fi
|
||||
grep '^void proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
|
||||
done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
|
||||
grep '^proto_reg_handoff_[a-z_0-9A-Z]* *(' $files 2>/dev/null | grep -v ';' \
|
||||
| sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
|
||||
|
||||
grep '^void proto_reg_handoff_[a-z_0-9A-Z]* *(' $files 2>/dev/null | grep -v ';' \
|
||||
| sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>${outfile}-tmp
|
||||
else
|
||||
cat <<"EOF" >>${outfile}-tmp
|
||||
void
|
||||
register_all_protocol_handoffs(register_cb cb, gpointer client_data)
|
||||
{
|
||||
EOF
|
||||
for f in "$@"
|
||||
do
|
||||
if [ -f $f ]
|
||||
then
|
||||
srcfile=$f
|
||||
else
|
||||
srcfile=$srcdir/$f
|
||||
fi
|
||||
grep '^proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
|
||||
done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); if(cb) (*cb)(RA_HANDOFF, \"\1\", client_data); \1 ();}/' >>${outfile}-tmp
|
||||
for f in "$@"
|
||||
do
|
||||
if [ -f $f ]
|
||||
then
|
||||
srcfile=$f
|
||||
else
|
||||
srcfile=$srcdir/$f
|
||||
fi
|
||||
grep '^void proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
|
||||
done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); if(cb) (*cb)(RA_HANDOFF, \"\1\", client_data); \1 ();}/' >>${outfile}-tmp
|
||||
grep '^proto_reg_handoff_[a-z_0-9A-Z]* *(' $files 2>/dev/null | grep -v ';' \
|
||||
| sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); if(cb) (*cb)(RA_HANDOFF, \"\1\", client_data); \1 ();}/' >>${outfile}-tmp
|
||||
|
||||
grep '^void proto_reg_handoff_[a-z_0-9A-Z]* *(' $files 2>/dev/null | grep -v ';' \
|
||||
| sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); if(cb) (*cb)(RA_HANDOFF, \"\1\", client_data); \1 ();}/' >>${outfile}-tmp
|
||||
fi
|
||||
echo '}' >>${outfile}-tmp
|
||||
if [ "$registertype" = plugin ]
|
||||
|
|
Loading…
Reference in New Issue