From 255755cb2a3abf34440792748325c98c9a61f766 Mon Sep 17 00:00:00 2001 From: Alan Brault Date: Mon, 2 May 2011 12:07:47 -0400 Subject: Partial autotools conversion to help out Joe --- configure.in | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 configure.in (limited to 'configure.in') diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..55836c2 --- /dev/null +++ b/configure.in @@ -0,0 +1,27 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.63]) +AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS]) +AM_INIT_AUTOMAKE(1.11.1) + +AC_CONFIG_SRCDIR([include/duser.h]) +AC_CONFIG_HEADERS([config.h]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. + +# Checks for header files. +AC_CHECK_HEADERS([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_CONFIG_FILES([Makefile]) +AC_OUTPUT -- cgit From 94e4efb2a769f18944d922f5a5e1567116635acf Mon Sep 17 00:00:00 2001 From: Alan Brault Date: Mon, 2 May 2011 12:26:56 -0400 Subject: More autotools migration --- configure.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 55836c2..4ab0207 100644 --- a/configure.in +++ b/configure.in @@ -5,11 +5,13 @@ AC_PREREQ([2.63]) AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS]) AM_INIT_AUTOMAKE(1.11.1) -AC_CONFIG_SRCDIR([include/duser.h]) +AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADERS([config.h]) # Checks for programs. AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_INSTALL # Checks for libraries. @@ -23,5 +25,5 @@ AC_TYPE_SIZE_T AC_FUNC_MALLOC AC_CHECK_FUNCS([memset strcasecmp strdup strerror strncasecmp strstr]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT -- cgit From d538d7194beef487985a5082ac63b672c3930ffe Mon Sep 17 00:00:00 2001 From: Alan Brault Date: Mon, 2 May 2011 12:55:38 -0400 Subject: Add platform detection for Linux vs Solaris --- configure.in | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 4ab0207..300a44b 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,9 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS]) +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_SRCDIR([config.h.in]) @@ -25,5 +27,23 @@ AC_TYPE_SIZE_T AC_FUNC_MALLOC AC_CHECK_FUNCS([memset strcasecmp strdup strerror strncasecmp strstr]) -AC_CONFIG_FILES([Makefile src/Makefile]) -AC_OUTPUT +# Set compiler options based on platform. +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_" + ;; + *) + AC_MSG_ERROR([duser does not currently support your platform]) + ;; +esac + +AC_OUTPUT([Makefile src/Makefile]) -- cgit