Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rust library filename on Windows #3

Merged
merged 4 commits into from
Jan 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,9 @@
;;
*-*-mingw32*|*-*-msys)
CFLAGS="${CFLAGS} -DOS_WIN32"
LDFLAGS="${LDFLAGS} -lws2_32 -liphlpapi -lwbemuuid -lOle32 -lOleAut32 -lUuid"
WINDOWS_PATH="yes"
AC_DEFINE([HAVE_NON_POSIX_MKDIR], [1], [mkdir is not POSIX compliant: single arg])
RUST_SURICATA_LIBNAME="suricata.lib"
RUST_LDADD="-luserenv -lshell32 -ladvapi32 -lgcc_eh"
RUST_LDADD=" -lws2_32 -liphlpapi -lwbemuuid -lOle32 -lOleAut32 -lUuid -luserenv -lshell32 -ladvapi32 -lgcc_eh"
;;
*-*-cygwin)
LUA_LIB_NAME="lua"
Expand Down Expand Up @@ -2406,10 +2404,11 @@ fi
fi

if test "x$enable_debug" = "xyes"; then
RUST_SURICATA_LIB="../rust/target/${RUST_SURICATA_LIB_XC_DIR}debug/${RUST_SURICATA_LIBNAME}"
RUST_SURICATA_LIBDIR="../rust/target/${RUST_SURICATA_LIB_XC_DIR}debug"
else
RUST_SURICATA_LIB="../rust/target/${RUST_SURICATA_LIB_XC_DIR}release/${RUST_SURICATA_LIBNAME}"
RUST_SURICATA_LIBDIR="../rust/target/${RUST_SURICATA_LIB_XC_DIR}release"
fi
RUST_SURICATA_LIB="${RUST_SURICATA_LIBDIR}/${RUST_SURICATA_LIBNAME}"

RUST_LDADD="${RUST_SURICATA_LIB} ${RUST_LDADD}"
CFLAGS="${CFLAGS} -I\${srcdir}/../rust/gen/c-headers"
Expand Down Expand Up @@ -2592,6 +2591,8 @@ AC_SUBST(CONFIGURE_SYSCONDIR)
AC_SUBST(CONFIGURE_LOCALSTATEDIR)
AC_SUBST(CONFIGURE_DATAROOTDIR)
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(RUST_FEATURES)
AC_SUBST(RUST_SURICATA_LIBDIR)

AC_CONFIG_FILES(Makefile src/Makefile rust/Makefile rust/Cargo.toml rust/.cargo/config)
AC_CONFIG_FILES(qa/Makefile qa/coccinelle/Makefile)
Expand Down
4 changes: 4 additions & 0 deletions rust/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ else
$(CARGO) build $(RELEASE) \
--features "$(RUST_FEATURES)" $(RUST_TARGET)
endif
if test -e $(RUST_SURICATA_LIBDIR)/suricata.lib; then \
cp $(RUST_SURICATA_LIBDIR)/suricata.lib \
$(RUST_SURICATA_LIBDIR)/libsuricata.a; \
fi

clean-local:
-rm -rf target gen
Expand Down