diff --git a/pam/generate.sh b/pam/generate.sh index de978003c..24c5ead51 100755 --- a/pam/generate.sh +++ b/pam/generate.sh @@ -2,11 +2,11 @@ set -euo pipefail -PROEJECT_ROOT=$PWD/.. +PROJECT_ROOT=$PWD/.. module_libname=pam_authd.so loader_libname=pam_go_loader.so -if [ -d "$PROEJECT_ROOT"/vendor ]; then +if [ -d "$PROJECT_ROOT"/vendor ]; then echo Vendored dependencies detected, not re-generating pam_module.go else go run github.com/msteinert/pam/v2/cmd/pam-moduler \ @@ -20,8 +20,8 @@ if [ -v AUTHD_PAM_MODULES_PATH ]; then fi ${CC:-cc} -o go-loader/"$loader_libname" \ - go-loader/module.c -Wl,--as-needed -Wl,--allow-shlib-undefined \ + go-loader/module.c ${CFLAGS:-} -Wl,--as-needed -Wl,--allow-shlib-undefined \ -shared -fPIC -Wl,--unresolved-symbols=report-all \ - -Wl,-soname,"$loader_libname" -lpam "${cc_args[@]}" + -Wl,-soname,"$loader_libname" -lpam ${LDFLAGS:-} "${cc_args[@]}" chmod 644 go-loader/"$loader_libname"