chiark / gitweb /
Portability fixes.
[userv.git] / configure.in
index ce9285a08cfd2a2ef42af0ada16a60804562953b..7b842ce1a93b1e9400f557e9a35c8f2b11709dad 100644 (file)
@@ -32,13 +32,28 @@ AC_ARG_ENABLE(debug,
  if test "x$enable_debug" = xyes; then
   DEBUGDEFS="-DDEBUG -DVARDIR='\"$crdir/vd\"' -DSYSTEMCONFIGDIR='\"$crdir/slash-etc\"' -DSERVICEUSERDIR='\"$crdir/tilde\"'"
   DEBUGLIBS=-lefence
+  echo will build debugging version
  elif test "x$enable_debug" != xno; then
   AC_MSG_ERROR(--enable-debug does not allow any arguments except 'yes' and 'no')
  fi
 ])
 
 AC_PROG_CC
-AC_SYS_LONG_FILE_NAMES
+AC_PROG_CPP
+AC_PROG_INSTALL
+
+AC_CACHE_CHECK(for EPROTO,userv_cv_hdr_eproto,
+ AC_EGREP_CPP(yes,
+[
+#include <errno.h>
+#ifdef EPROTO
+ yes
+#endif
+],userv_cv_hdr_eproto=yes,userv_cv_hdr_eproto=no))
+if test $userv_cv_hdr_eproto = yes
+then
+       AC_DEFINE(HAVE_EPROTO)
+fi
 
 AC_SUBST(OPTIMISE)
 if test "${GCC-no}" = yes; then
@@ -77,10 +92,10 @@ DPKG_CACHED_TRY_COMPILE(__attribute__((,,)),dpkg_cv_c_attribute_supported,,
    AC_MSG_RESULT(yes)
    AC_DEFINE(HAVE_GNUC25_NORETURN),
    AC_MSG_RESULT(no))
-  DPKG_CACHED_TRY_COMPILE(__attribute__((const)),dpkg_cv_c_attribute_const,,
-   [extern int testfunction(int x) __attribute__((const))],
+  DPKG_CACHED_TRY_COMPILE(__attribute__((unused)),dpkg_cv_c_attribute_unused,,
+   [extern int testfunction(int x) __attribute__((unused))],
    AC_MSG_RESULT(yes)
-   AC_DEFINE(HAVE_GNUC25_CONST),
+   AC_DEFINE(HAVE_GNUC25_UNUSED),
    AC_MSG_RESULT(no))
   DPKG_CACHED_TRY_COMPILE(__attribute__((format...)),dpkg_cv_attribute_format,,
    [extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))],
@@ -129,4 +144,8 @@ if test "${GCC-no}" = yes; then
 fi
 [CFLAGS="`echo $CFLAGS $CWARNS | sed -e 's/-O[0-9]*/$(OPTIMISE)/'`"]
 
+AC_SUBST(VERSION)
+VERSION="`sed -n '/^userv (.*)/!d; s/^userv (//; s/).*//; p; q' Changelog`"
+echo will build version $VERSION
+
 AC_OUTPUT(Makefile)