Re: How to compile...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 25, 2004 at 07:32:38AM -0600, Jason Gerfen wrote:
> Hello, I am fairly new to this list and have been attempting to learn 
> how to write PAM modules however the documentation on how to use the PAM 
> api is bit vague on how to compile the existing C.
> 
> I am using SuSE 9.0 and using Emacs to edit my first pam module.  The 
> string I am using to compile is as so...
> 
> gcc -o pam_test.so -libpam pam_test.c pam_test.h

Here's the Makefile I use:

-- CUT HERE --
CC=gcc
CFLAGS=-fPIC -O2 -Wall -Werror -pedantic
CPPFLAGS=-I.
LDFLAGS=-x --shared -lpam

OUT=pam_test.so

all:    $(OUT)

%.so: %.o
	ld $(LDFLAGS) -o $@ $<

clean:
	rm -f *.o $(OUT)

install:
	install -s -o0 -g0 -m755 $(OUT) /lib/security
-- CUT HERE --

This would cause two commands to be executed:
gcc -fPIC -O2 -Wall -Werror -pedantic -I.  -c -o pam_test.o pam_test.c
ld -x --shared -lpam -o pam_test.so pam_test.o

Presumably, you have an appropriate #include in pam_test.c for
pam_test.h...

-- 
Ed Schmollinger - schmolli@xxxxxxxxxxxxxx

Attachment: pgp00142.pgp
Description: PGP signature

_______________________________________________

Pam-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/pam-list

[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux