]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/Makefile.linux
Merge pull request #181 from pali/get_first_ethernet
[ppp.git] / pppd / Makefile.linux
index 8d5ce99d92202c4326730393c0d9e56d327fbefe..44d47ad7f46f35bce09a86998cf4ebaab2ebd15f 100644 (file)
@@ -33,7 +33,7 @@ endif
 # CC = gcc
 #
 COPTS = -O2 -pipe -Wall -g
-LIBS =
+LIBS = -lrt
 
 # Uncomment the next line to include support for Microsoft's
 # MS-CHAP authentication protocol.  Also, edit plugins/radius/Makefile.linux.
@@ -81,6 +81,9 @@ PLUGIN=y
 # Use libutil
 USE_LIBUTIL=y
 
+# Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
+USE_EAPTLS=y
+
 MAXOCTETS=y
 
 INCLUDE_DIRS= -I../include
@@ -99,13 +102,15 @@ CFLAGS   += -DMSLANMAN=1
 endif
 ifdef MPPE
 CFLAGS   += -DMPPE=1
+HEADERS  += mppe.h
 endif
 endif
 
 # EAP SRP-SHA1
 ifdef USE_SRP
 CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
-LIBS   += -lsrp -L/usr/local/ssl/lib -lcrypto
+LIBS   += -lsrp -L/usr/local/ssl/lib
+NEEDCRYPTOLIB = y
 TARGETS        += srp-entry
 EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
 MANPAGES += srp-entry.8
@@ -120,12 +125,22 @@ HEADERS += sha1.h
 PPPDOBJS += sha1.o
 endif
 
+# EAP-TLS
+ifdef USE_EAPTLS
+CFLAGS += -DUSE_EAPTLS=1
+LIBS += -lssl
+NEEDCRYPTOLIB = y
+PPPDSRC += eap-tls.c
+HEADERS += eap-tls.h
+PPPDOBJS += eap-tls.o
+endif
+
 ifdef HAS_SHADOW
 CFLAGS   += -DHAS_SHADOW
 #LIBS     += -lshadow $(LIBS)
 endif
 
-ifneq ($(wildcard /usr/include/crypt.h),)
+ifneq ($(wildcard $(shell $(CC) --print-sysroot)/usr/include/crypt.h),)
 CFLAGS  += -DHAVE_CRYPT_H=1
 LIBS   += -lcrypt
 endif
@@ -137,8 +152,8 @@ endif
 
 ifdef NEEDDES
 ifndef USE_CRYPT
-CFLAGS   += -I/usr/include/openssl
-LIBS     += -lcrypto
+CFLAGS   += -I$(shell $(CC) --print-sysroot)/usr/include/openssl
+NEEDCRYPTOLIB = y
 else
 CFLAGS   += -DUSE_CRYPT=1
 endif
@@ -146,6 +161,10 @@ PPPDOBJS += pppcrypt.o
 HEADERS += pppcrypt.h
 endif
 
+ifdef NEEDCRYPTOLIB
+LIBS     += -lcrypto
+endif
+
 # For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
 ifdef USE_PAM
 CFLAGS   += -DUSE_PAM