aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorAlan Brault <alan.brault@incruentatus.net>2011-05-02 14:49:17 -0400
committerAlan Brault <alan.brault@incruentatus.net>2011-05-02 14:49:17 -0400
commitef3b0ff8f11db1e1dddb3047dee8e2a313247395 (patch)
tree448ca7ddc9e0e9800af36f8fa8052eb2e290de73 /configure.in
parentd538d7194beef487985a5082ac63b672c3930ffe (diff)
downloadduser-ef3b0ff8f11db1e1dddb3047dee8e2a313247395.tar.gz
Move CFG_PATH out of duser.h and put into configure via --with-config-path
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in27
1 files changed, 15 insertions, 12 deletions
diff --git a/configure.in b/configure.in
index 300a44b..7a97a17 100644
--- a/configure.in
+++ b/configure.in
@@ -7,8 +7,8 @@ AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.11.1)
-AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_SRCDIR([src/duser.c])
# Checks for programs.
AC_PROG_CC
@@ -18,32 +18,35 @@ AC_PROG_INSTALL
# Checks for libraries.
# Checks for header files.
-AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h])
+AC_CHECK_HEADERS_ONCE([fcntl.h limits.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
# Checks for library functions.
AC_FUNC_MALLOC
-AC_CHECK_FUNCS([memset strcasecmp strdup strerror strncasecmp strstr])
+AC_CHECK_FUNCS_ONCE([memset strcasecmp strdup strerror strncasecmp strstr])
-# Set compiler options based on platform.
+# Checks for currently used operating system.
case "$host_os" in
*linux*)
- echo "==========================================================="
- echo "Setting up build environment for ${target_cpu}${target_os}"
- echo "==========================================================="
CFLAGS="-O2 -Wall -Wextra -I../include"
;;
*solaris*)
- echo "==========================================================="
- echo "Setting up build environment for ${target_cpu}${target_os}"
- echo "==========================================================="
- CFLAGS="-O2 -Wall -D_NLINUX_"
+ CFLAGS="-O2 -Wall -D_NLINUX_ -I../include"
;;
*)
- AC_MSG_ERROR([duser does not currently support your platform])
+ CFLAGS="-O2 -Wall -Wextra -I../include"
;;
esac
+# Figure out where everything goes in the filesystem
+AC_ARG_WITH(config-path,
+ AC_HELP_STRING([--with-config-path=<pathname>],
+ [specify the path for duser config files (default: /usr/local/etc/duser)]),
+ [CFGPATH="$withval"], [CFGPATH="/usr/local/etc/duser"])
+AC_SUBST(CONFIGDIR)
+
+AC_DEFINE_UNQUOTED([CFG_PATH], "$CFGPATH", [duser configuration path])
+
AC_OUTPUT([Makefile src/Makefile])