summaryrefslogtreecommitdiff
path: root/package/cifs-utils/patches/patch-configure_ac
blob: 7355a238c09002385b2b407e37bc1213d72f8671 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- cifs-utils-6.7.orig/configure.ac	2017-03-02 17:51:05.000000000 +0100
+++ cifs-utils-6.7/configure.ac	2017-03-27 01:54:09.082783577 +0200
@@ -93,13 +93,25 @@ AC_CHECK_TYPES([ptrdiff_t, ssize_t, uint
 
 # Checks for library functions.
 AC_FUNC_GETMNTENT
-AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
-AC_FUNC_MALLOC
-AC_FUNC_REALLOC
-AC_FUNC_STRNLEN
 
 # check for required functions
-AC_CHECK_FUNCS([alarm atexit endpwent getmntent getpass gettimeofday inet_ntop memset realpath setenv strchr strcmp strdup strerror strncasecmp strndup strpbrk strrchr strstr strtol strtoul tolower uname], , [AC_MSG_ERROR([necessary functions(s) not found])])
+AC_CHECK_FUNCS([alarm atexit endpwent getmntent getpass gettimeofday inet_ntop malloc memset realloc realpath setenv strchr strcmp strdup strerror strncasecmp strndup strnlen strpbrk strrchr strstr strtol strtoul tolower uname], , [AC_MSG_ERROR([necessary functions(s) not found])])
+
+AC_CHECK_FUNCS([getopt_long], , [AC_MSG_ERROR([getopt_long function not found])])
+AC_MSG_CHECKING([if getopt_long is GNU specific])
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#include <features.h>
+#ifndef __GLIBC__
+#error No GNU extension
+#endif
+        ]],[[;]])
+    ],[
+      AC_DEFINE(HAVE_GNU_GETOPT_LONG, 1, [Whether getopt_long has GNU extensions])
+      AC_MSG_RESULT([yes])
+    ],[
+      AC_LIBOBJ([gnu_getopt])
+      AC_MSG_RESULT([no])
+])
 
 AC_CHECK_FUNCS(clock_gettime, [], [
   AC_CHECK_LIB(rt, clock_gettime, [