2 AC_INIT([rc-scripts], [0.5.3], [tld-devel@lists.tld-linux.org], [rc-scripts])
4 dnl Do not require AUTHORS, ChangeLog, NEWS, and README to exist
5 AM_INIT_AUTOMAKE([foreign])
9 echo -n "Finding shell scripts"
11 for shfile in $(find ${srcdir}/rc.d ${srcdir}/sysconfig ${srcdir}/lib ! -path "*/\.*/*" ! -name "*~" -type f); do
13 if (LC_ALL=C file ${shfile} | grep -q 'shell script'); then
14 SHSCRIPTS="${SHSCRIPTS} ${shfile}"
19 dnl Checks for programs.
26 pppdir='${sysconfdir}/ppp'
27 sysconfigdir='${sysconfdir}/sysconfig'
28 updir='${sysconfigdir}/interfaces/up.d'
29 downdir='${sysconfigdir}/interfaces/down.d'
30 networkscriptsdir='${exec_prefix}/lib/${PACKAGE}'
31 rcdir='${sysconfdir}/rc.d'
32 initdir='${sysconfdir}/init'
33 firmwaredir='${exec_prefix}/lib/firmware'
34 docdir="${prefix}/doc/${PACKAGE}-${VERSION}"
37 AC_PATH_PROGS(MSGMERGE, msgmerge)
38 AC_PATH_PROGS(GMSGFMT, gmsgfmt msgfmt)
40 if test -z "$MSGMERGE" || test -z "$GMSGFMT"; then
41 AC_MSG_ERROR(install gettext-devel to be able to regenerate translations)
46 for lang in $ALL_LINGUAS; do
47 CATALOGS="$CATALOGS $lang.gmo"
48 POTFILES="$POTFILES $lang.po"
52 for src in $SHSCRIPTS; do
53 POTSRC="$POTSRC \$(top_srcdir)/$src"
55 AC_ARG_WITH(localedir,
56 [ --with-localedir=PATH specify where the locale stuff should go ])
58 if test "x$LOCALEDIR" = "x"; then
59 if test "x$with_localedir" != "x"; then
60 LOCALEDIR=$with_localedir
62 LOCALEDIR='$(prefix)/share/locale'
67 gnulocaledir=$LOCALEDIR
69 if test "`eval echo $sysconfdir`" = "NONE/etc"; then
70 defaultdir="/usr/local/etc"
72 defaultdir="`eval echo $sysconfdir`"
75 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
76 if test "$PKG_CONFIG" = no; then
77 AC_MSG_ERROR(You need to install pkgconfig package)
81 AC_MSG_CHECKING([glib2])
82 GLIB_LIBS="-Wl,-static `$PKG_CONFIG --libs --static glib-2.0` -Wl,-Bdynamic"
83 GLIB_CFLAGS="`$PKG_CONFIG --cflags-only-I glib-2.0`"
84 if test "x$GLIB_LIBS" = "x"; then
89 DPKG_C_GCC_ATTRIBUTE([,,],supported,[int x],[,,],ATTRIB,[Define if function attributes a la GCC 2.5 and higher are available.],
90 DPKG_C_GCC_ATTRIBUTE(noreturn,noreturn,[int x],noreturn,NORETURN,[Define if nonreturning functions a la GCC 2.5 and higher are available.])
91 DPKG_C_GCC_ATTRIBUTE(const,const,[int x],const,CONST,[Define if constant functions a la GCC 2.5 and higher are available.])
92 DPKG_C_GCC_ATTRIBUTE(unused,unused,[int x],unused,UNUSED,[Define if unused variables la GCC 2.5 and higher are available.])
93 DPKG_C_GCC_ATTRIBUTE(format...,format,[char *y, ...],[format(printf,1,2)],PRINTFFORMAT,[Define if printf-format argument lists a la GCC are available.]))
95 AC_CHECK_TYPE(ptrdiff_t,int)
96 AC_CHECK_HEADERS([stddef.h sys/capability.h getopt.h])
104 AC_SUBST(gnulocaledir)
107 AC_SUBST(networkscriptsdir)
108 AC_SUBST(sysconfigdir)
114 AC_SUBST(firmwaredir)
116 AC_SUBST(GLIB_CFLAGS)
123 /* Use the definitions: */
125 /* The maximum length of a #! interpreter displayed by dpkg-deb. */
127 #define INTERPRETER_MAX PATH_MAX
129 #define INTERPRETER_MAX 1024
132 /* GNU C attributes. */
134 #ifdef HAVE_GNUC25_ATTRIB
135 #define FUNCATTR(x) __attribute__(x)
141 /* GNU C printf formats, or null. */
143 #ifdef HAVE_GNUC25_PRINTFFORMAT
144 #define ATTRPRINTF(si,tc) format(printf,si,tc)
146 #define ATTRPRINTF(si,tc)
150 #define PRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc)))
153 /* GNU C nonreturning functions, or null. */
155 #ifdef HAVE_GNUC25_NORETURN
156 #define ATTRNORETURN noreturn
157 #else /* ! HAVE_GNUC25_NORETURN */
159 #endif /* HAVE_GNUC25_NORETURN */
160 #endif /* ATTRNORETURN */
163 #define NONRETURNING FUNCATTR((ATTRNORETURN))
164 #endif /* NONRETURNING */
166 /* Combination of both the above. */
167 #ifndef NONRETURNPRINTFFORMAT
168 #define NONRETURNPRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc),ATTRNORETURN))
171 /* GNU C constant functions, or null. */
173 #ifdef HAVE_GNUC25_CONST
174 #define ATTRCONST const
180 #define CONSTANT FUNCATTR((ATTRCONST))
183 /* GNU C unused functions, or null. */
185 #ifdef HAVE_GNUC25_UNUSED
192 #define UNUSED FUNCATTR((ATTRUNUSED))
196 AC_CONFIG_HEADERS(src/config.h)
197 AC_CONFIG_FILES([Makefile \
211 sysconfig/cpusets/Makefile \
212 sysconfig/hwprofiles/Makefile \
213 sysconfig/interfaces/Makefile \
214 sysconfig/interfaces/data/Makefile \
215 sysconfig/interfaces/up.d/Makefile \
216 sysconfig/interfaces/up.d/all/Makefile \
217 sysconfig/interfaces/up.d/ip/Makefile \
218 sysconfig/interfaces/up.d/ipx/Makefile \
219 sysconfig/interfaces/up.d/ppp/Makefile \
220 sysconfig/interfaces/up.d/tnl/Makefile \
221 sysconfig/interfaces/down.d/Makefile \
222 sysconfig/interfaces/down.d/all/Makefile \
223 sysconfig/interfaces/down.d/ip/Makefile \
224 sysconfig/interfaces/down.d/ipx/Makefile \
225 sysconfig/interfaces/down.d/ppp/Makefile \
226 sysconfig/interfaces/down.d/tnl/Makefile \
227 rc.d/Makefile rc.d/init.d/Makefile \