Remove make-dissector-reg and require python for autotool builds as well
Change-Id: I6239063a08ba37199a4e95302a3650a80544c750 Reviewed-on: https://code.wireshark.org/review/3562 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
This commit is contained in:
parent
433eeda109
commit
65ac652a07
|
@ -119,6 +119,8 @@ if test ! -z "$PYTHON"; then
|
|||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR(I couldn't find python; make sure it's installed and in your path)
|
||||
fi
|
||||
|
||||
#
|
||||
|
|
|
@ -97,17 +97,11 @@ x11-dissector: $(top_srcdir)/tools/process-x11-fields.pl x11-fields $(top_srcdir
|
|||
# a register.c file for libwireshark.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
register.c: $(plugin_src) $(ALL_DISSECTORS_SRC) Makefile.common Custom.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making register.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
dissectors $(ALL_DISSECTORS_SRC) ; \
|
||||
else \
|
||||
echo Making register.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
dissectors $(plugin_src) $(ALL_DISSECTORS_SRC) ; \
|
||||
fi
|
||||
register.c: $(plugin_src) $(ALL_DISSECTORS_SRC) Makefile.common Custom.common \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making register.c ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
dissectors $(ALL_DISSECTORS_SRC) ;
|
||||
#
|
||||
# Currently register.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -81,18 +81,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -81,18 +81,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -81,18 +81,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -83,18 +83,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -81,18 +81,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -81,18 +81,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -88,18 +88,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -82,18 +82,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -81,18 +81,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -82,18 +82,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -81,18 +81,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -84,18 +84,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -81,18 +81,10 @@ LIBS =
|
|||
# a plugin.c file for a plugin.
|
||||
# All subsequent arguments are the files to scan.
|
||||
#
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg \
|
||||
$(top_srcdir)/tools/make-dissector-reg.py
|
||||
@if test -n "$(PYTHON)"; then \
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ; \
|
||||
else \
|
||||
echo Making plugin.c with shell script ; \
|
||||
$(top_srcdir)/tools/make-dissector-reg $(srcdir) \
|
||||
$(plugin_src) plugin $(REGISTER_SRC_FILES) ; \
|
||||
fi
|
||||
|
||||
plugin.c: $(REGISTER_SRC_FILES) Makefile.common $(top_srcdir)/tools/make-dissector-reg.py
|
||||
echo Making plugin.c with python ; \
|
||||
$(PYTHON) $(top_srcdir)/tools/make-dissector-reg.py $(srcdir) \
|
||||
plugin $(REGISTER_SRC_FILES) ;
|
||||
#
|
||||
# Currently plugin.c can be included in the distribution because
|
||||
# we always build all protocol dissectors. We used to have to check
|
||||
|
|
|
@ -146,7 +146,6 @@ EXTRA_DIST = \
|
|||
lex.py \
|
||||
list_protos_in_cap.sh \
|
||||
Makefile.nmake \
|
||||
make-dissector-reg \
|
||||
make-dissector-reg.py \
|
||||
make-manuf \
|
||||
make-sminmpec.pl \
|
||||
|
|
|
@ -1,146 +0,0 @@
|
|||
#! /bin/sh
|
||||
|
||||
#
|
||||
# The first argument is the directory in which the source files live.
|
||||
#
|
||||
srcdir="$1"
|
||||
shift
|
||||
|
||||
#
|
||||
# The second argument is either "plugin" or "dissectors"; if it's
|
||||
# "plugin", we build a plugin.c for a plugin, and if it's
|
||||
# "dissectors", we build a register.c for libwireshark.
|
||||
#
|
||||
registertype="$1"
|
||||
shift
|
||||
if [ "$registertype" = plugin ]
|
||||
then
|
||||
outfile="plugin.c"
|
||||
elif [ "$registertype" = dissectors ]
|
||||
then
|
||||
outfile="register.c"
|
||||
else
|
||||
echo "Unknown output type '$registertype'" 1>&2
|
||||
exit 1
|
||||
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
|
||||
if [ "$registertype" = plugin ]
|
||||
then
|
||||
cat <<"EOF" >>${outfile}-tmp
|
||||
#include "config.h"
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "moduleinfo.h"
|
||||
/* plugins are DLLs */
|
||||
#define WS_BUILD_DLL
|
||||
#include "ws_symbol_export.h"
|
||||
|
||||
#ifndef ENABLE_STATIC
|
||||
WS_DLL_PUBLIC_DEF const gchar version[] = VERSION;
|
||||
|
||||
/* Start the functions we need for the plugin stuff */
|
||||
|
||||
WS_DLL_PUBLIC_DEF void
|
||||
plugin_register (void)
|
||||
{
|
||||
EOF
|
||||
#
|
||||
# Build code to call all the protocol registration routines.
|
||||
#
|
||||
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"
|
||||
void
|
||||
register_all_protocols(register_cb cb, gpointer client_data)
|
||||
{
|
||||
EOF
|
||||
#
|
||||
# Build code to call all the protocol registration routines.
|
||||
#
|
||||
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
|
||||
|
||||
|
||||
#
|
||||
# Build code to call all the protocol handoff registration routines.
|
||||
#
|
||||
if [ "$registertype" = plugin ]
|
||||
then
|
||||
cat <<"EOF" >>${outfile}-tmp
|
||||
WS_DLL_PUBLIC_DEF void
|
||||
plugin_reg_handoff(void)
|
||||
{
|
||||
EOF
|
||||
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
|
||||
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 ]
|
||||
then
|
||||
echo '#endif' >>${outfile}-tmp
|
||||
else
|
||||
cat <<"EOF" >>${outfile}-tmp
|
||||
gulong register_count(void)
|
||||
{
|
||||
EOF
|
||||
proto_regs=`grep -c RA_REGISTER ${outfile}-tmp`
|
||||
handoff_regs=`grep -c RA_HANDOFF ${outfile}-tmp`
|
||||
echo " return $proto_regs + $handoff_regs;" >>${outfile}-tmp
|
||||
echo '}' >>${outfile}-tmp
|
||||
fi
|
||||
|
||||
# Only overwrite outfile if it differs from newly generated file
|
||||
if cmp -s ${outfile}-tmp ${outfile}
|
||||
then
|
||||
rm ${outfile}-tmp
|
||||
else
|
||||
mv ${outfile}-tmp ${outfile}
|
||||
fi
|
Loading…
Reference in New Issue