Use CPPFLAGS, LDFLAGS and LIBS as appropiate.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 6 Oct 2003 16:05:30 +0000 (16:05 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 6 Oct 2003 16:05:30 +0000 (16:05 +0000)
m4/lzo.m4
m4/openssl.m4
m4/zlib.m4

index 147318f..33d47d3 100644 (file)
--- a/m4/lzo.m4
+++ b/m4/lzo.m4
@@ -2,27 +2,23 @@ dnl Check to find the lzo headers/libraries
 
 AC_DEFUN(tinc_LZO,
 [
-  tinc_ac_save_CPPFLAGS="$CPPFLAGS"
-
   AC_ARG_WITH(lzo,
     AC_HELP_STRING([--with-lzo=DIR], [lzo base directory, or:]),
     [lzo="$withval"
-     CFLAGS="$CFLAGS -I$withval/include"
      CPPFLAGS="$CPPFLAGS -I$withval/include"
-     LIBS="$LIBS -L$withval/lib"]
+     LDFLAGS="$LDFLAGS -L$withval/lib"]
   )
 
   AC_ARG_WITH(lzo-include,
     AC_HELP_STRING([--with-lzo-include=DIR], [lzo headers directory]),
     [lzo_include="$withval"
-     CFLAGS="$CFLAGS -I$withval"
      CPPFLAGS="$CPPFLAGS -I$withval"]
   )
 
   AC_ARG_WITH(lzo-lib,
     AC_HELP_STRING([--with-lzo-lib=DIR], [lzo library directory]),
     [lzo_lib="$withval"
-     LIBS="$LIBS -L$withval"]
+     LDFLAGS="$LDFLAGS -L$withval"]
   )
 
   AC_CHECK_HEADERS(lzo1x.h,
@@ -30,8 +26,6 @@ AC_DEFUN(tinc_LZO,
     [AC_MSG_ERROR("lzo header files not found."); break]
   )
 
-  CPPFLAGS="$tinc_ac_save_CPPFLAGS"
-
   AC_CHECK_LIB(lzo, lzo1x_1_compress,
     [LIBS="$LIBS -llzo"],
     [AC_MSG_ERROR("lzo libraries not found.")]
index 32e41de..f4415cc 100644 (file)
@@ -2,27 +2,23 @@ dnl Check to find the OpenSSL headers/libraries
 
 AC_DEFUN(tinc_OPENSSL,
 [
-  tinc_ac_save_CPPFLAGS="$CPPFLAGS"
-
   AC_ARG_WITH(openssl,
     AC_HELP_STRING([--with-openssl=DIR], [OpenSSL base directory, or:]),
     [openssl="$withval"
-     CFLAGS="$CFLAGS -I$withval/include"
      CPPFLAGS="$CPPFLAGS -I$withval/include"
-     LIBS="$LIBS -L$withval/lib"]
+     LDFLAGS="$LDFLAGS -L$withval/lib"]
   )
 
   AC_ARG_WITH(openssl-include,
     AC_HELP_STRING([--with-openssl-include=DIR], [OpenSSL headers directory (without trailing /openssl)]),
     [openssl_include="$withval"
-     CFLAGS="$CFLAGS -I$withval"
      CPPFLAGS="$CPPFLAGS -I$withval"]
   )
 
   AC_ARG_WITH(openssl-lib,
     AC_HELP_STRING([--with-openssl-lib=DIR], [OpenSSL library directory]),
     [openssl_lib="$withval"
-     LIBS="$LIBS -L$withval"]
+     LDFLAGS="$LDFLAGS -L$withval"]
   )
 
   AC_CHECK_HEADERS(openssl/evp.h openssl/rsa.h openssl/rand.h openssl/err.h openssl/sha.h openssl/pem.h,
@@ -30,8 +26,6 @@ AC_DEFUN(tinc_OPENSSL,
     [AC_MSG_ERROR([OpenSSL header files not found.]); break]
   )
 
-  CPPFLAGS="$tinc_ac_save_CPPFLAGS"
-
 case $host_os in
   *mingw*)
     AC_CHECK_LIB(crypto, SHA1_version,
index d691326..dcf2c3a 100644 (file)
@@ -2,27 +2,23 @@ dnl Check to find the zlib headers/libraries
 
 AC_DEFUN(tinc_ZLIB,
 [
-  tinc_ac_save_CPPFLAGS="$CPPFLAGS"
-
   AC_ARG_WITH(zlib,
     AC_HELP_STRING([--with-zlib=DIR], [zlib base directory, or:]),
     [zlib="$withval"
-     CFLAGS="$CFLAGS -I$withval/include"
      CPPFLAGS="$CPPFLAGS -I$withval/include"
-     LIBS="$LIBS -L$withval/lib"]
+     LDFLAGS="$LDFLAGS -L$withval/lib"]
   )
 
   AC_ARG_WITH(zlib-include,
     AC_HELP_STRING([--with-zlib-include=DIR], [zlib headers directory]),
     [zlib_include="$withval"
-     CFLAGS="$CFLAGS -I$withval"
      CPPFLAGS="$CPPFLAGS -I$withval"]
   )
 
   AC_ARG_WITH(zlib-lib,
     AC_HELP_STRING([--with-zlib-lib=DIR], [zlib library directory]),
     [zlib_lib="$withval"
-     LIBS="$LIBS -L$withval"]
+     LDFLAGS="$LDFLAGS -L$withval"]
   )
 
   AC_CHECK_HEADERS(zlib.h,
@@ -30,8 +26,6 @@ AC_DEFUN(tinc_ZLIB,
     [AC_MSG_ERROR("zlib header files not found."); break]
   )
 
-  CPPFLAGS="$tinc_ac_save_CPPFLAGS"
-
   AC_CHECK_LIB(z, compress2,
     [LIBS="$LIBS -lz"],
     [AC_MSG_ERROR("zlib libraries not found.")]