summaryrefslogtreecommitdiffstats
path: root/gl/m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/gnulib-cache.m44
-rw-r--r--gl/m4/gnulib-comp.m426
-rw-r--r--gl/m4/idpriv.m414
-rw-r--r--gl/m4/strcase.m445
-rw-r--r--gl/m4/strings_h.m452
5 files changed, 138 insertions, 3 deletions
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 2ed3509..d6fca2a 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -27,7 +27,7 @@
27 27
28 28
29# Specification in the form of a command-line invocation: 29# Specification in the form of a command-line invocation:
30# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files base64 crypto/sha1 dirname environ floorf fsusage getaddrinfo gethostname getloadavg getopt-gnu gettext mountlist regex setenv strsep timegm unsetenv vasprintf vsnprintf 30# gnulib-tool --import --dir=. --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files base64 crypto/sha1 dirname environ floorf fsusage getaddrinfo gethostname getloadavg getopt-gnu gettext idpriv-droptemp mountlist regex setenv strcase strsep timegm unsetenv vasprintf vsnprintf
31 31
32# Specification in the form of a few gnulib-tool.m4 macro invocations: 32# Specification in the form of a few gnulib-tool.m4 macro invocations:
33gl_LOCAL_DIR([]) 33gl_LOCAL_DIR([])
@@ -43,9 +43,11 @@ gl_MODULES([
43 getloadavg 43 getloadavg
44 getopt-gnu 44 getopt-gnu
45 gettext 45 gettext
46 idpriv-droptemp
46 mountlist 47 mountlist
47 regex 48 regex
48 setenv 49 setenv
50 strcase
49 strsep 51 strsep
50 timegm 52 timegm
51 unsetenv 53 unsetenv
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index f23f769..67a8156 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -28,7 +28,7 @@
28# other built files. 28# other built files.
29 29
30 30
31# This macro should be invoked from ./configure.in, in the section 31# This macro should be invoked from ./configure.ac, in the section
32# "Checks for programs", right after AC_PROG_CC, and certainly before 32# "Checks for programs", right after AC_PROG_CC, and certainly before
33# any checks for libraries, header files, types and library functions. 33# any checks for libraries, header files, types and library functions.
34AC_DEFUN([gl_EARLY], 34AC_DEFUN([gl_EARLY],
@@ -70,6 +70,7 @@ AC_DEFUN([gl_EARLY],
70 # Code from module gettext-h: 70 # Code from module gettext-h:
71 # Code from module havelib: 71 # Code from module havelib:
72 # Code from module hostent: 72 # Code from module hostent:
73 # Code from module idpriv-droptemp:
73 # Code from module include_next: 74 # Code from module include_next:
74 # Code from module inet_ntop: 75 # Code from module inet_ntop:
75 # Code from module intprops: 76 # Code from module intprops:
@@ -119,10 +120,12 @@ AC_DEFUN([gl_EARLY],
119 # Code from module stdint: 120 # Code from module stdint:
120 # Code from module stdio: 121 # Code from module stdio:
121 # Code from module stdlib: 122 # Code from module stdlib:
123 # Code from module strcase:
122 # Code from module streq: 124 # Code from module streq:
123 # Code from module strerror: 125 # Code from module strerror:
124 # Code from module strerror-override: 126 # Code from module strerror-override:
125 # Code from module string: 127 # Code from module string:
128 # Code from module strings:
126 # Code from module strndup: 129 # Code from module strndup:
127 # Code from module strnlen: 130 # Code from module strnlen:
128 # Code from module strsep: 131 # Code from module strsep:
@@ -151,7 +154,7 @@ AC_DEFUN([gl_EARLY],
151 # Code from module xstrndup: 154 # Code from module xstrndup:
152]) 155])
153 156
154# This macro should be invoked from ./configure.in, in the section 157# This macro should be invoked from ./configure.ac, in the section
155# "Check for header files, types and library functions". 158# "Check for header files, types and library functions".
156AC_DEFUN([gl_INIT], 159AC_DEFUN([gl_INIT],
157[ 160[
@@ -256,6 +259,7 @@ AC_DEFUN([gl_INIT],
256 AC_SUBST([LIBINTL]) 259 AC_SUBST([LIBINTL])
257 AC_SUBST([LTLIBINTL]) 260 AC_SUBST([LTLIBINTL])
258 gl_HOSTENT 261 gl_HOSTENT
262 gl_IDPRIV
259 gl_FUNC_INET_NTOP 263 gl_FUNC_INET_NTOP
260 if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then 264 if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then
261 AC_LIBOBJ([inet_ntop]) 265 AC_LIBOBJ([inet_ntop])
@@ -377,6 +381,15 @@ AC_DEFUN([gl_INIT],
377 gl_STDINT_H 381 gl_STDINT_H
378 gl_STDIO_H 382 gl_STDIO_H
379 gl_STDLIB_H 383 gl_STDLIB_H
384 gl_STRCASE
385 if test $HAVE_STRCASECMP = 0; then
386 AC_LIBOBJ([strcasecmp])
387 gl_PREREQ_STRCASECMP
388 fi
389 if test $HAVE_STRNCASECMP = 0; then
390 AC_LIBOBJ([strncasecmp])
391 gl_PREREQ_STRNCASECMP
392 fi
380 gl_FUNC_STRERROR 393 gl_FUNC_STRERROR
381 if test $REPLACE_STRERROR = 1; then 394 if test $REPLACE_STRERROR = 1; then
382 AC_LIBOBJ([strerror]) 395 AC_LIBOBJ([strerror])
@@ -390,6 +403,7 @@ AC_DEFUN([gl_INIT],
390 gl_PREREQ_SYS_H_WINSOCK2 403 gl_PREREQ_SYS_H_WINSOCK2
391 fi 404 fi
392 gl_HEADER_STRING_H 405 gl_HEADER_STRING_H
406 gl_HEADER_STRINGS_H
393 gl_FUNC_STRNDUP 407 gl_FUNC_STRNDUP
394 if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then 408 if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
395 AC_LIBOBJ([strndup]) 409 AC_LIBOBJ([strndup])
@@ -646,6 +660,8 @@ AC_DEFUN([gl_FILE_LIST], [
646 lib/glthread/lock.c 660 lib/glthread/lock.c
647 lib/glthread/lock.h 661 lib/glthread/lock.h
648 lib/glthread/threadlib.c 662 lib/glthread/threadlib.c
663 lib/idpriv-droptemp.c
664 lib/idpriv.h
649 lib/inet_ntop.c 665 lib/inet_ntop.c
650 lib/intprops.h 666 lib/intprops.h
651 lib/itold.c 667 lib/itold.c
@@ -706,12 +722,15 @@ AC_DEFUN([gl_FILE_LIST], [
706 lib/stdio.in.h 722 lib/stdio.in.h
707 lib/stdlib.in.h 723 lib/stdlib.in.h
708 lib/str-two-way.h 724 lib/str-two-way.h
725 lib/strcasecmp.c
709 lib/streq.h 726 lib/streq.h
710 lib/strerror-override.c 727 lib/strerror-override.c
711 lib/strerror-override.h 728 lib/strerror-override.h
712 lib/strerror.c 729 lib/strerror.c
713 lib/string.in.h 730 lib/string.in.h
731 lib/strings.in.h
714 lib/stripslash.c 732 lib/stripslash.c
733 lib/strncasecmp.c
715 lib/strndup.c 734 lib/strndup.c
716 lib/strnlen.c 735 lib/strnlen.c
717 lib/strsep.c 736 lib/strsep.c
@@ -775,6 +794,7 @@ AC_DEFUN([gl_FILE_LIST], [
775 m4/gnulib-common.m4 794 m4/gnulib-common.m4
776 m4/hostent.m4 795 m4/hostent.m4
777 m4/iconv.m4 796 m4/iconv.m4
797 m4/idpriv.m4
778 m4/include_next.m4 798 m4/include_next.m4
779 m4/inet_ntop.m4 799 m4/inet_ntop.m4
780 m4/intdiv0.m4 800 m4/intdiv0.m4
@@ -845,8 +865,10 @@ AC_DEFUN([gl_FILE_LIST], [
845 m4/stdint_h.m4 865 m4/stdint_h.m4
846 m4/stdio_h.m4 866 m4/stdio_h.m4
847 m4/stdlib_h.m4 867 m4/stdlib_h.m4
868 m4/strcase.m4
848 m4/strerror.m4 869 m4/strerror.m4
849 m4/string_h.m4 870 m4/string_h.m4
871 m4/strings_h.m4
850 m4/strndup.m4 872 m4/strndup.m4
851 m4/strnlen.m4 873 m4/strnlen.m4
852 m4/strsep.m4 874 m4/strsep.m4
diff --git a/gl/m4/idpriv.m4 b/gl/m4/idpriv.m4
new file mode 100644
index 0000000..167f523
--- /dev/null
+++ b/gl/m4/idpriv.m4
@@ -0,0 +1,14 @@
1# idpriv.m4 serial 1
2dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_IDPRIV],
8[
9 dnl Persuade glibc <unistd.h> to declare {get,set}res{uid,gid}.
10 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
11
12 AC_CHECK_FUNCS_ONCE([getuid geteuid getresuid getgid getegid getresgid])
13 AC_CHECK_FUNCS_ONCE([setresuid setreuid seteuid setresgid setregid setegid])
14])
diff --git a/gl/m4/strcase.m4 b/gl/m4/strcase.m4
new file mode 100644
index 0000000..22bf57c
--- /dev/null
+++ b/gl/m4/strcase.m4
@@ -0,0 +1,45 @@
1# strcase.m4 serial 11
2dnl Copyright (C) 2002, 2005-2013 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_STRCASE],
8[
9 gl_FUNC_STRCASECMP
10 gl_FUNC_STRNCASECMP
11])
12
13AC_DEFUN([gl_FUNC_STRCASECMP],
14[
15 AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
16 AC_CHECK_FUNCS([strcasecmp])
17 if test $ac_cv_func_strcasecmp = no; then
18 HAVE_STRCASECMP=0
19 fi
20])
21
22AC_DEFUN([gl_FUNC_STRNCASECMP],
23[
24 AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
25 AC_CHECK_FUNCS([strncasecmp])
26 if test $ac_cv_func_strncasecmp = yes; then
27 HAVE_STRNCASECMP=1
28 else
29 HAVE_STRNCASECMP=0
30 fi
31 AC_CHECK_DECLS([strncasecmp])
32 if test $ac_cv_have_decl_strncasecmp = no; then
33 HAVE_DECL_STRNCASECMP=0
34 fi
35])
36
37# Prerequisites of lib/strcasecmp.c.
38AC_DEFUN([gl_PREREQ_STRCASECMP], [
39 :
40])
41
42# Prerequisites of lib/strncasecmp.c.
43AC_DEFUN([gl_PREREQ_STRNCASECMP], [
44 :
45])
diff --git a/gl/m4/strings_h.m4 b/gl/m4/strings_h.m4
new file mode 100644
index 0000000..76ef242
--- /dev/null
+++ b/gl/m4/strings_h.m4
@@ -0,0 +1,52 @@
1# Configure a replacement for <strings.h>.
2# serial 6
3
4# Copyright (C) 2007, 2009-2013 Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9AC_DEFUN([gl_HEADER_STRINGS_H],
10[
11 dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12 dnl once only, before all statements that occur in other macros.
13 AC_REQUIRE([gl_HEADER_STRINGS_H_BODY])
14])
15
16AC_DEFUN([gl_HEADER_STRINGS_H_BODY],
17[
18 AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
19
20 gl_CHECK_NEXT_HEADERS([strings.h])
21 if test $ac_cv_header_strings_h = yes; then
22 HAVE_STRINGS_H=1
23 else
24 HAVE_STRINGS_H=0
25 fi
26 AC_SUBST([HAVE_STRINGS_H])
27
28 dnl Check for declarations of anything we want to poison if the
29 dnl corresponding gnulib module is not in use.
30 gl_WARN_ON_USE_PREPARE([[
31 /* Minix 3.1.8 has a bug: <sys/types.h> must be included before
32 <strings.h>. */
33 #include <sys/types.h>
34 #include <strings.h>
35 ]], [ffs strcasecmp strncasecmp])
36])
37
38AC_DEFUN([gl_STRINGS_MODULE_INDICATOR],
39[
40 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
41 AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS])
42 gl_MODULE_INDICATOR_SET_VARIABLE([$1])
43])
44
45AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS],
46[
47 GNULIB_FFS=0; AC_SUBST([GNULIB_FFS])
48 dnl Assume proper GNU behavior unless another module says otherwise.
49 HAVE_FFS=1; AC_SUBST([HAVE_FFS])
50 HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP])
51 HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP])
52])