Re: How to compile...

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

 



Well I got it to compile successfully by issuing this from the command line:

gcc -fPIC -c pam_test.o
ld -x --shared -o pam_test.so pam_test.o

Thanks for all the help...

Ed Schmollinger wrote:

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...



------------------------------------------------------------------------

_______________________________________________

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




--
Jason Gerfen
Student Computing Group
Marriott Library
University of Utah
(801) 585-9810
jason.Gerfen@xxxxxxxxxxxx

"...Sometimes I just yell at myself. And it
makes me sad, sometimes I make myself cry..."
			~ My nephew Dawsyn



_______________________________________________

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