Skip to content

Commit

Permalink
configure: Reorder and entierly configure DPDK
Browse files Browse the repository at this point in the history
Some dependencies, like towards pkg-config are still necessary when
building. Now, everything is taken at configure time.

Also re-order configure options and do a few fixes
  • Loading branch information
tbarbette committed Feb 11, 2021
1 parent 3e634e7 commit f7639a4
Show file tree
Hide file tree
Showing 5 changed files with 644 additions and 480 deletions.
22 changes: 18 additions & 4 deletions click-buildtool.in
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ $bad_first_files" | sort | uniq -u`
files="$files
${ppfx}$i"
fi
if expr "$checksum_data" != "" '&' "${ppfx}$i" : '[^$
if expr "$checksum_data" != "" '&' "${ppfx}$i" : '[^$
]*$' >/dev/null; then
checksum_files="$checksum_files ${ppfx}$i"
elif test -n "$checksum_data"; then rm -f "$checksum_data"; checksum_data=; fi
Expand Down Expand Up @@ -493,6 +493,13 @@ $bad_files" | sort | uniq -u`
{
split($2, deps, / +/);
for (j in deps) {
if (deps[j] ~ /^!/) {
i = substr(deps[j],2)
if (dep[i] > 0) {
print $1;
break;
}
} else {
i = deps[j]
if (dep[i] <= 0) {
bad = 1;
Expand All @@ -506,6 +513,7 @@ $bad_files" | sort | uniq -u`
break;
}
}
}
}
}' | sort | uniq`
if test -n "$verbose"; then
Expand Down Expand Up @@ -601,7 +609,7 @@ $bad_files"
++errors
}
/static_initialize/ {
static_initialize[cur_class] = 1
static_initialize[cur_class] = 1;
next
}
/static_cleanup/ {
Expand Down Expand Up @@ -651,6 +659,11 @@ END {
} else
klass = substr(exes[j], star + 1)
if (static_initialize[klass]) {
if (!class_name[klass]) {
print header[i], ": ", klass, "::static_initialied can only be used with a class_name method!" | "cat 1>&2"
++errors
}
ex = ex klass "-!si ";
static_initialize[klass] = 0
}
Expand Down Expand Up @@ -1056,6 +1069,7 @@ END {
print "#ifdef CLICK_LINUXMODULE\n#define click_add_element_type_stable(n, f, t) click_add_element_type_stable((n), (f), (t), 0)\n#endif";
print "void\nclick_export_elements()\n{\n", B, " CLICK_DMALLOC_REG(\"nXXX\");\n}\n";
print "void\nclick_unexport_elements()\n{\n", C, "}";
print "void\nclick_delete_element(Element* e)\n{\ndelete e;}";
}
'
fi
Expand Down Expand Up @@ -1672,9 +1686,9 @@ EOF
compile-shortensyms)
shift 1; compile_shortensyms "$@"; exit 0;;
--cf|--cfl|--cfla|--cflag|--cflags|--d|--de|--def|--defs)
echo @PROPER_INCLUDES@ @PCAP_INCLUDES@ @DPDK_INCLUDES@ @NETMAP_INCLUDES@ -I@includedir@; exit 0;;
echo @PROPER_INCLUDES@ @PCAP_INCLUDES@ @DPDK_INCLUDES@ @DPDK_CFLAGS@ @NETMAP_INCLUDES@ -I@includedir@; exit 0;;
--o|--ot|--oth|--othe|--other|--otherl|--otherli|--otherlib|--otherlibs)
echo @PROPER_LIBS@ @PCAP_LIBS@ @DL_LIBS@ @SOCKET_LIBS@ @PTHREAD_LIBS@ @POSIX_CLOCK_LIBS@;
echo @PROPER_LIBS@ @PCAP_LIBS@ @DL_LIBS@ @SOCKET_LIBS@ @DPDK_LIBS@ @PTHREAD_LIBS@ @POSIX_CLOCK_LIBS@;
exit 0;;
--toolc|--toolcf|--toolcfl|--toolcfla|--toolcflag|--toolcflags)
echo -DCLICK_TOOL -I@includedir@; exit 0;;
Expand Down
22 changes: 16 additions & 6 deletions click-compile.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ cflags=
compileflag=-c
quiet=
gpl=y
objonly=n
exit=
while true; do
bad=x
Expand Down Expand Up @@ -83,6 +84,8 @@ while true; do
quiet=y; shift 1;;
--no-g|--no-gp|--no-gpl)
gpl=n; shift 1;;
-o|--objs)
objonly=y; shift 1;;
-h|--h|--he|--hel|--help)
cat <<'EOF'
'Click-compile' compiles a Click source file, or outputs any compiler options
Expand All @@ -103,6 +106,7 @@ Options:
-q, --quiet Be quiet (don't echo commands or print warnings).
--no-gpl Omit "BSD/GPL" declaration from kernel package.
-h, --help Print this message and exit.
-o, --objs Only compile package's .o files
-v, --version Print version number and exit.
Other options are passed to the compiler unchanged.
Expand Down Expand Up @@ -188,10 +192,10 @@ fi
case $driver in
u|us|use|user|userl|userle|userlev|userleve|userlevel)
idefs="@DEFS@ -DCLICK_USERLEVEL"
iincludes="${include_source} -I${includedir}"
iincludes="${include_source} -I${includedir} @DPDK_INCLUDES@"
icppflags="@CPPFLAGS@"
icxxflags="-fPIC @CXXFLAGS@ @DEPCFLAGS@"
icflags="-fPIC @CFLAGS@ @DEPCFLAGS@"
icxxflags="-fPIC @CXXFLAGS@ @DPDK_CFLAGS@ @DEPCFLAGS@"
icflags="-fPIC @CFLAGS@ @DPDK_CFLAGS@ @DEPCFLAGS@"
command="${CXX-@CXX@} ${DEFS-$idefs} ${INCLUDES-$iincludes} ${CPPFLAGS-$icppflags} ${CXXFLAGS-$icxxflags} $cflags $compileflag"
c_command="${CC-@CC@} ${DEFS-$idefs} ${INCLUDES-$iincludes} ${CPPFLAGS-$icppflags} ${CFLAGS-$icflags} $cflags $compileflag"
driver=userlevel;;
Expand Down Expand Up @@ -262,14 +266,19 @@ if test "x$package" != "xNONE"; then
trap 'rm -f $rmfiles; exit 1' 1 2 15
for file; do
if echo "$file" | grep '\.cc*$' >/dev/null 2>&1; then
objfile=`echo "$file" | sed 's/\.c*$/'"$$"'\.o/;s/^.*\///'`
if test $objonly = y; then
objfile=`echo "$file" | sed 's/\.c*$/\.o/;s/^.*\///'`
else
objfile=`echo "$file" | sed 's/\.c*$/'"$$"'\.o/;s/^.*\///'`
rmfiles="$rmfiles $objfile "`echo $objfile | sed 's/\.o/\.d/'`
fi
compile_file $file -o $objfile
rmfiles="$rmfiles $objfile "`echo $objfile | sed 's/\.o/\.d/'`
else
objfile="$file"
fi
files="$files $objfile"
done
if test $objonly != y; then
if test $driver = linuxmodule; then
vfile=kernelversion$$
test -f $vfile.c && echo "click-compile: A file '$vfile.c' already exists in this directory!" 1>&2 && echo "click-compile: You must remove it, or run me somewhere else." 1>&2 && exit 1
Expand All @@ -294,11 +303,12 @@ EOF
exit 0
elif test $driver = userlevel -o $driver = tool -o $driver = ns; then
exec_command "${CXX-@CXX@} ${CXXFLAGS-$icxxflags} @LDMODULEFLAGS@ -o $package $cflags $files"
exit 0
exit 0
elif test $driver = bsdmodule; then
exec_command "ld -Bshareable -o $package $cflags $files"
exit 0
fi
fi
else
exec_command "$command $@"
exit 0
Expand Down
Loading

0 comments on commit f7639a4

Please sign in to comment.