On Jun 1, 2005, at 1:58 PM, C.J. Harris wrote:

This is a farly late reply, But I been having problems
compiling pam_mysql, the paths to mysql libraries is
/usr/local/mysql/lib and include files are in
/usr/local/mysql/include but when I edit these into
the make file, Make give me hundreds of errors. Does
any one have experience or tips to install pam_mysql?


My Makefile is below. What are some of the errors? Look for the first error and see if it is a missing file or file that cannot be found. If it is, then it is probably something else that you need to use yum to install in order to get this working.

# Convenient defaults for compiling independently of the full source
# tree.
ifndef FULL_LINUX_PAM_SOURCE_TREE
export DYNAMIC=-DPAM_DYNAMIC
export CC=gcc
export CFLAGS=-O2 -Dlinux -DLINUX_PAM \
       -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
       -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional \
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline \
       -Wshadow -pedantic -fPIC -I/usr/local/mysql/include
export MKDIR=mkdir -p
export LD_D=gcc -shared -Xlinker -x -L/usr/local/mysql/lib/mysql -lz
endif

#
#

TITLE=pam_mysql

#

LIBSRC = $(TITLE).c
LIBOBJ = $(TITLE).o
LIBOBJD = $(addprefix dynamic/,$(LIBOBJ))
LIBOBJS = $(addprefix static/,$(LIBOBJ))

ifdef DYNAMIC
LIBSHARED = $(TITLE).so
endif

ifdef STATIC
LIBSTATIC = lib$(TITLE).o
endif

####################### don't edit below #######################

all: dirs $(LIBSHARED) $(LIBSTATIC) register

dynamic/%.o : %.c
        $(CC) $(CFLAGS) $(DYNAMIC) $(TARGET_ARCH) -c $< -o $@

static/%.o : %.c
        $(CC) $(CFLAGS) $(STATIC) $(TARGET_ARCH) -c $< -o $@

dirs:
ifdef DYNAMIC
        $(MKDIR) ./dynamic
endif
ifdef STATIC
        $(MKDIR) ./static
endif

register:
ifdef STATIC
        ( cd .. ; ./register_static $(TITLE) $(TITLE)/$(LIBSTATIC) )
endif

ifdef DYNAMIC
$(LIBOBJD): $(LIBSRC)
endif

ifdef DYNAMIC
$(LIBSHARED):   $(LIBOBJD)
                $(LD_D) -o $@ $(LIBOBJD)  -lmysqlclient -lcrypt
#               cp pam_mysql.so /lib/security/pam_mysql.so
endif

ifdef STATIC
$(LIBOBJS): $(LIBSRC)
endif

ifdef STATIC
$(LIBSTATIC): $(LIBOBJS)
        $(LD) -r -o $@ $(LIBOBJS)  -lmysqlclient -lcrypt
endif

install: all
        $(MKDIR) $(FAKEROOT)$(SECUREDIR)
ifdef DYNAMIC
        $(INSTALL) -m $(SHLIBMODE) $(LIBSHARED) $(FAKEROOT)$(SECUREDIR)
endif

remove:
        rm -f $(FAKEROOT)$(SECUREDIR)/$(TITLE).so

clean:
        rm -f $(LIBOBJD) $(LIBOBJS) core *~

extraclean: clean
        rm -f *.a *.o *.so *.bak

.c.o:
        $(CC) $(CFLAGS) -c $<


Howard Shere
http://blogs.greendragon.com/index.php/gdc
Altair 8800a to Mac OS X so far...

_______________________________________________
yellowdog-general mailing list
[email protected]
http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-general
HINT: to Google archives, try  '<keywords> site:terrasoftsolutions.com'

Reply via email to