Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 1 | From b86575ab4a0df07da160283459da270e1c0372a0 Mon Sep 17 00:00:00 2001 |
| 2 | From: "Maxin B. John" <maxin.john@intel.com> |
| 3 | Date: Tue, 24 May 2016 14:11:09 +0300 |
| 4 | Subject: [PATCH] crypt_configure |
| 5 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 6 | This patch fixes a case where it find crypt defined in libc (musl) but |
| 7 | not in specified libraries then it ends up assigning |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 8 | LIBCRYPT="-l" which then goes into makefile cause all sort of problems |
| 9 | e.g. |
| 10 | |
| 11 | ld: cannot find -l-m32 |
| 12 | | collect2: error: ld returned 1 exit status |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 13 | The reason is that -l appears on commandline with |
| 14 | out any library and compiler treats the next argument as library name |
| 15 | whatever it is. |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | |
| 17 | Upstream-Status: Pending |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 18 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 19 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 20 | Signed-off-by: Maxin B. John <maxin.john@intel.com> |
| 21 | --- |
| 22 | configure.ac | 2 +- |
| 23 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 24 | |
| 25 | diff --git a/configure.ac b/configure.ac |
| 26 | index df39d07..e68d856 100644 |
| 27 | --- a/configure.ac |
| 28 | +++ b/configure.ac |
| 29 | @@ -401,7 +401,7 @@ AS_IF([test "x$ac_cv_header_xcrypt_h" = "xyes"], |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 30 | [crypt_libs="crypt"]) |
| 31 | |
| 32 | BACKUP_LIBS=$LIBS |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 33 | -AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="${ac_lib:+-l$ac_lib}", LIBCRYPT="") |
| 34 | +AC_SEARCH_LIBS([crypt],[$crypt_libs], [test "$ac_cv_search_crypt" = "none required" || LIBCRYPT="$ac_cv_search_crypt"]) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | AC_CHECK_FUNCS(crypt_r crypt_gensalt_r) |
| 36 | LIBS=$BACKUP_LIBS |
| 37 | AC_SUBST(LIBCRYPT) |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 38 | -- |
| 39 | 2.4.0 |
| 40 | |