aboutsummaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunk@stsci.edu>2011-04-22 07:46:02 -0400
committerJoseph Hunkeler <jhunk@stsci.edu>2012-05-25 14:20:36 -0400
commitdb970762d90a3adda07874ac597928f5305b0a49 (patch)
tree605a01281d2227d85048e0fe6875de5635170a71 /configure.in
parente30f9651d86b2ae2b21e144de9bde78922e96284 (diff)
downloadduser-db970762d90a3adda07874ac597928f5305b0a49.tar.gz
Initial commit
Partial autotools conversion to help out Joe More autotools migration More autotools migration Add platform detection for Linux vs Solaris Move CFG_PATH out of duser.h and put into configure via --with-config-path Forgot to define ifdef for HAVE_CONFIG_H sigh Add configure checks for strchrnul() and strcasestr() and config.h entries Add __NLINUX__ and __NSOLARIS__ platform checks to configure and config.h entries Forgot compat.c for Solaris platforms sigh Fix spelling mistake: comat.c -> compat.c Fixed typo Make strcasestr() and strchrnul() into separate compat files Force everyone to use compat functions not just Solaris Remove libsysfs from buildconf Add libtool support (needed for libdusercompat.a)
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in61
1 files changed, 61 insertions, 0 deletions
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..212f199
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,61 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.63])
+AC_INIT([duser], [1.0.0], [jhunkeler@stsci.edu], [duser], [https://github.com/jhunkeler/duser.git])
+AC_CANONICAL_TARGET
+
+AM_INIT_AUTOMAKE(1.11.1)
+
+AC_CONFIG_HEADERS([include/config.h])
+AC_CONFIG_SRCDIR([src/duser.c])
+
+# Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+
+# Initializing libtool.
+AC_DISABLE_SHARED
+AC_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+LIBTOOL="$LIBTOOL --silent"
+
+# Checks for libraries.
+
+# Checks for header files.
+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_ONCE([memset strcasecmp strdup strerror strncasecmp strstr strchrnul strcasestr])
+
+# Detect if the host operating system is SunOS/Solaris as it behaves slightly different
+# than GNU/Linux
+case "$host_os" in
+ *sunos*|solaris*)
+ AC_DEFINE([HAVE_SOLARIS], 1, [host operating system is solaris])
+ ;;
+ *)
+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])
+
+# Compiler Warnings Options
+AC_ARG_ENABLE(warnings,
+AC_HELP_STRING([--enable-warnings],[Enable all sorts of warnings for debugging.]),
+[CFLAGS="$CFLAGS -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wredundant-decls -Wshadow -Wwrite-strings -W -Wno-unused"],[])
+
+AC_OUTPUT([Makefile compat/Makefile src/Makefile])