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

Support i386 #820

Closed
wants to merge 3 commits into from
Closed
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
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
PAM_SRC_DIR = src/pam

BINDGEN_CMD = bindgen --allowlist-function '^pam_.*$$' --allowlist-var '^PAM_.*$$' --opaque-type pam_handle_t --ctypes-prefix libc
BINDGEN_CMD = bindgen --merge-extern-blocks --allowlist-function '^pam_.*$$' --allowlist-var '^PAM_.*$$' --opaque-type pam_handle_t --ctypes-prefix libc

.PHONY: all clean pam-sys pam-sys-diff

pam-sys-diff: $(PAM_SRC_DIR)/wrapper.h
@$(BINDGEN_CMD) $< | diff --color=auto $(PAM_SRC_DIR)/sys.rs - || (echo run \'make -B pam-sys\' to apply these changes && false)
@$(BINDGEN_CMD) $< -- --target=x86_64-pc-linux-gnu | diff --color=auto $(PAM_SRC_DIR)/sys/x86_64_linux.rs - || (echo run \'make -B pam-sys\' to apply these changes && false)
@echo $(PAM_SRC_DIR)/sys.rs does not need to be re-generated

# use 'make pam-sys' to re-generate the sys.rs file
pam-sys: $(PAM_SRC_DIR)/sys.rs
pam-sys: $(PAM_SRC_DIR)/sys/x86_64_linux.rs $(PAM_SRC_DIR)/sys/i386_linux.rs

$(PAM_SRC_DIR)/sys.rs: $(PAM_SRC_DIR)/wrapper.h
$(BINDGEN_CMD) $< --output $@
$(PAM_SRC_DIR)/sys/x86_64_linux.rs: $(PAM_SRC_DIR)/wrapper.h
$(BINDGEN_CMD) $< --output $@ -- --target=x86_64-pc-linux-gnu

$(PAM_SRC_DIR)/sys/i386_linux.rs: $(PAM_SRC_DIR)/wrapper.h
$(BINDGEN_CMD) $< --output $@ -- --target=i386-pc-linux-gnu

clean:
rm $(PAM_SRC_DIR)/sys.rs
rm $(PAM_SRC_DIR)/sys/x86_64_linux.rs
Loading
Loading