Skip to content

Commit

Permalink
Fix some linking issues.
Browse files Browse the repository at this point in the history
On Ubuntu 16.04 I had trouble making this compile. There was one notable
change required - the libraries to link (ppm.so and LIBS) need to be
given after the file being compiled. It also seems helpful to link
ppm.so against the required libraries, otherwise how will slapd know to
find libcrack?

Finally, I added -Wl,-rpath=. to ppm_test meaning it can be run directly
without needing to set the library path.
  • Loading branch information
tdb committed Jul 20, 2017
1 parent 4358a5e commit 0b46c24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -40,13 +40,13 @@ TESTS=./unit_tests.sh
all: ppm ppm_test

ppm_test:
$(CC) $(LDAP_INC) $(LDAP_LIBS) $(LIBS) ppm.so -o ppm_test ppm_test.c
$(CC) $(LDAP_INC) $(LDAP_LIBS) -Wl,-rpath=. -o ppm_test ppm_test.c ppm.so $(LIBS)

ppm.o:
$(CC) $(OPT) -c $(INCS) ppm.c

ppm: clean ppm.o
$(CC) $(LDAP_INC) -shared -o ppm.so ppm.o
$(CC) $(LDAP_INC) -shared -o ppm.so ppm.o $(CRACK_LIB)

install: ppm
cp -f ppm.so $(LIBDIR)
Expand Down

0 comments on commit 0b46c24

Please sign in to comment.