aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid M. Syzdek <syzdek@bindlebinaries.com>2014-07-29 08:11:21 -0800
committerDavid M. Syzdek <syzdek@bindlebinaries.com>2014-07-29 08:11:21 -0800
commitb11fcb06f514ef8ad94c384cd0df86075a285b39 (patch)
treefdfb49fb781594c33d814395a5a4b7183810b252
parente354bf496235b20435a645a940803e1f5560a084 (diff)
downloaddmstools-b11fcb06f514ef8ad94c384cd0df86075a285b39.tar.gz
dmstools-b11fcb06f514ef8ad94c384cd0df86075a285b39.tar.bz2
dmstools-b11fcb06f514ef8ad94c384cd0df86075a285b39.tar.xz
dmstools-b11fcb06f514ef8ad94c384cd0df86075a285b39.zip
Cleaning up autoconf file.
-rw-r--r--acinclude.m490
-rw-r--r--configure.ac96
2 files changed, 117 insertions, 69 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 3badb9d..8b156bd 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1,6 +1,6 @@
1# 1#
2# DMS Tools and Utilities 2# DMS Tools and Utilities
3# Copyright (C) 2008 David M. Syzdek <david@syzdek.net> 3# Copyright (C) 2014 David M. Syzdek <david@syzdek.net>
4# 4#
5# @SYZDEK_LICENSE_HEADER_START@ 5# @SYZDEK_LICENSE_HEADER_START@
6# 6#
@@ -34,46 +34,54 @@
34# acinclude.m4 - custom m4 macros used by configure.ac 34# acinclude.m4 - custom m4 macros used by configure.ac
35# 35#
36 36
37# AC_DMS_GIT_PACKAGE_VERSION() 37# AC_DMS_WIN32
38# ----------------------------------- 38# ______________________________________________________________________________
39AC_DEFUN([AC_DMS_GIT_PACKAGE_VERSION],[dnl 39AC_DEFUN([AC_DMS_WIN32],[dnl
40 40
41 if test -f ${srcdir}/.git/config;then 41 # prerequists
42 GPV=$(git describe --abbrev=7 HEAD 2>/dev/null) 42 AC_REQUIRE([AC_PROG_CC])
43 GPV=$(echo "$GPV" | sed -e 's/-/./g') 43
44 GPV=$(echo "$GPV" | sed -e 's/^v//g') 44 # tests for windows platform
45 if test "x${GPV}" != "x";then 45 case $host in
46 AC_MSG_NOTICE([using git package version ${GPV}]) 46 *mingw*) win32_host='yes';;
47 if test -d ${ac_aux_dir};then 47 *) win32_host='no';;
48 echo ${GPV} > ${ac_aux_dir}/git-package-version 48 esac
49 fi 49
50 fi 50 AM_CONDITIONAL([IS_WIN32], [test x$win32_host = xyes])
51 elif test -f ${ac_aux_dir}/git-package-version;then 51])dnl
52 GPV=$(cat ${ac_aux_dir}/git-package-version) 52
53 if test -d ${ac_aux_dir};then 53
54 AC_MSG_NOTICE([using cached git package version ${GPV}]) 54# AC_DMS_REGEX
55 fi 55# ______________________________________________________________________________
56 fi 56AC_DEFUN([AC_DMS_REGEX],[dnl
57 57
58 if test "x${GPV}" = "x";then 58 # prerequists
59 AC_MSG_WARN([unable to determine package version from Git tags]) 59 AC_REQUIRE([AC_PROG_CC])
60 else 60
61 # 61 have_regex=yes
62 # set internal variables 62 AC_SEARCH_LIBS([regcomp], [regex],,[have_regex=no])
63 GIT_PACKAGE_VERSION=${GPV} 63 AC_SEARCH_LIBS([regexec], [regex],,[have_regex=no])
64 PACKAGE_VERSION=${GPV} 64 AC_SEARCH_LIBS([regfree], [regex],,[have_regex=no])
65 VERSION=${GPV} 65 AC_SEARCH_LIBS([regerror], [regex],,[have_regex=no])
66 # 66
67 # set substitution variables 67 AM_CONDITIONAL([HAVE_REGEX], [test x$have_regex = xyes])
68 AC_SUBST([GIT_PACKAGE_VERSION], [${GPV}]) 68])dnl
69 AC_SUBST([PACKAGE_VERSION], [${GPV}]) 69
70 AC_SUBST([VERSION], [${GPV}]) 70
71 # 71# AC_DMS_SIGNAL
72 # set C/C++/Objc preprocessor macros 72# ______________________________________________________________________________
73 AC_DEFINE_UNQUOTED([GIT_PACKAGE_VERSION], ["${GIT_PACKAGE_VERSION}"], [package version determined from git repository]) 73AC_DEFUN([AC_DMS_SIGNAL],[dnl
74 AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["${GIT_PACKAGE_VERSION}"], [package version determined from git repository]) 74
75 AC_DEFINE_UNQUOTED([VERSION], ["${GIT_PACKAGE_VERSION}"], [package version determined from git repository]) 75 # prerequists
76 fi 76 AC_REQUIRE([AC_PROG_CC])
77
78 have_signal=yes
79 AC_CHECK_HEADERS([signal.h], ,[have_signal=no])
80 AC_CHECK_TYPES([sig_t], ,[have_signal=no],[#include <signal.h>])
81 AC_SEARCH_LIBS([signal], ,,[have_signal=no])
82
83 AM_CONDITIONAL([HAVE_SIGNAL], [test x$have_signal = xyes])
77])dnl 84])dnl
78 85
86
79# end of M4 file 87# end of M4 file
diff --git a/configure.ac b/configure.ac
index c1f0afa..e221f51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,7 +69,7 @@ AM_INIT_AUTOMAKE(gnu std-options subdir-objects color-tests)
69# Compilers 69# Compilers
70AC_PROG_CC 70AC_PROG_CC
71#AC_PROG_OBJC 71#AC_PROG_OBJC
72#AC_PROG_CXX 72AC_PROG_CXX
73AM_PROG_CC_C_O 73AM_PROG_CC_C_O
74AC_PROG_INSTALL 74AC_PROG_INSTALL
75#AC_USE_SYSTEM_EXTENSIONS # replaces AC_AIX AC_GNU_SOURCE AC_MINIX 75#AC_USE_SYSTEM_EXTENSIONS # replaces AC_AIX AC_GNU_SOURCE AC_MINIX
@@ -93,38 +93,74 @@ AC_PROG_LN_S
93# GNU Libtool Support 93# GNU Libtool Support
94LT_INIT(dlopen disable-fast-install win32-dll) 94LT_INIT(dlopen disable-fast-install win32-dll)
95 95
96# enables getopt_long if header and functions were found 96# check for common functions
97AC_CHECK_HEADERS([getopt.h], [AC_DEFINE_UNQUOTED(USE_GETOPT_LONG, 1, [Use GNU getopt_long])]) 97AC_FUNC_FORK
98AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
99AC_FUNC_MALLOC
100AC_FUNC_OBSTACK
101AC_FUNC_REALLOC
102AC_FUNC_STRERROR_R
103
104# Type checks
105AC_TYPE_INT8_T
106AC_TYPE_INT16_T
107AC_TYPE_INT32_T
108AC_TYPE_INT64_T
109AC_TYPE_MODE_T
110AC_TYPE_OFF_T
111AC_TYPE_SIZE_T
112AC_TYPE_SSIZE_T
113AC_TYPE_UID_T
114AC_TYPE_UINT8_T
115AC_TYPE_UINT16_T
116AC_TYPE_UINT32_T
117AC_TYPE_UINT64_T
118
119# check for required functions
120AC_CHECK_FUNCS([bzero], [], [AC_MSG_ERROR([missing required functions])])
121AC_CHECK_FUNCS([gettimeofday], [], [AC_MSG_ERROR([missing required functions])])
122AC_CHECK_FUNCS([memset], [], [AC_MSG_ERROR([missing required functions])])
123AC_CHECK_FUNCS([regcomp], [], [AC_MSG_ERROR([missing required functions])])
124AC_CHECK_FUNCS([setlocale], [], [AC_MSG_ERROR([missing required functions])])
125AC_CHECK_FUNCS([socket], [], [AC_MSG_ERROR([missing required functions])])
126AC_CHECK_FUNCS([strcasecmp], [], [AC_MSG_ERROR([missing required functions])])
127AC_CHECK_FUNCS([strchr], [], [AC_MSG_ERROR([missing required functions])])
128AC_CHECK_FUNCS([strdup], [], [AC_MSG_ERROR([missing required functions])])
129AC_CHECK_FUNCS([strerror], [], [AC_MSG_ERROR([missing required functions])])
130AC_CHECK_FUNCS([strncasecmp], [], [AC_MSG_ERROR([missing required functions])])
131AC_CHECK_FUNCS([strtol], [], [AC_MSG_ERROR([missing required functions])])
132AC_CHECK_FUNCS([strtoul], [], [AC_MSG_ERROR([missing required functions])])
133AC_CHECK_FUNCS([strtoumax], [], [AC_MSG_ERROR([missing required functions])])
134
135# check for headers
136AC_CHECK_HEADERS([arpa/inet.h], [], [AC_MSG_ERROR([missing required headers])])
137AC_CHECK_HEADERS([fcntl.h], [], [AC_MSG_ERROR([missing required headers])])
138AC_CHECK_HEADERS([getopt.h], [], [AC_MSG_ERROR([missing required headers])])
139AC_CHECK_HEADERS([libintl.h], [], [AC_MSG_ERROR([missing required headers])])
140AC_CHECK_HEADERS([locale.h], [], [AC_MSG_ERROR([missing required headers])])
141AC_CHECK_HEADERS([netdb.h], [], [AC_MSG_ERROR([missing required headers])])
142AC_CHECK_HEADERS([sgtty.h], [], [AC_MSG_ERROR([missing required headers])])
143AC_CHECK_HEADERS([stddef.h], [], [AC_MSG_ERROR([missing required headers])])
144AC_CHECK_HEADERS([sys/socket.h], [], [AC_MSG_ERROR([missing required headers])])
145AC_CHECK_HEADERS([sys/time.h], [], [AC_MSG_ERROR([missing required headers])])
146AC_CHECK_HEADERS([termios.h], [], [AC_MSG_ERROR([missing required headers])])
147AC_CHECK_HEADERS([utime.h], [], [AC_MSG_ERROR([missing required headers])])
148AC_CHECK_HEADERS([wchar.h], [], [AC_MSG_ERROR([missing required headers])])
149AC_CHECK_HEADERS([wctype.h], [], [AC_MSG_ERROR([missing required headers])])
150
151# check types
152AC_CHECK_TYPES([ptrdiff_t], [], [AC_MSG_ERROR([missing required data type])])
98 153
99# Symbol checks 154# Symbol checks
100AC_CHECK_DECLS([environ]) 155AC_CHECK_DECLS([environ])
101AC_CHECK_LIB([c], [arc4random],,[AC_DEFINE_UNQUOTED([USE_RANDOM], 1, [Use random()])]) 156AC_CHECK_LIB([c], [arc4random], [], [AC_DEFINE_UNQUOTED([USE_RANDOM], 1, [Use random()])])
102AC_CHECK_LIB([dl], [dlclose],,[AC_MSG_ERROR([missing required library -ldl])]) 157AC_CHECK_LIB([dl], [dlclose], [], [AC_MSG_ERROR([missing required library -ldl])])
103AC_CHECK_LIB([dl], [dlerror],,[AC_MSG_ERROR([missing required library -ldl])]) 158AC_CHECK_LIB([dl], [dlerror], [], [AC_MSG_ERROR([missing required library -ldl])])
104AC_CHECK_LIB([dl], [dlopen],,[AC_MSG_ERROR([missing required library -ldl])]) 159AC_CHECK_LIB([dl], [dlopen], [], [AC_MSG_ERROR([missing required library -ldl])])
105AC_CHECK_LIB([dl], [dlsym],,[AC_MSG_ERROR([missing required library -ldl])]) 160AC_CHECK_LIB([dl], [dlsym], [], [AC_MSG_ERROR([missing required library -ldl])])
106
107# tests for windows platform
108case $host in
109 *mingw*) win32_host='yes';;
110 *) win32_host='no';;
111esac
112AM_CONDITIONAL([IS_WIN32], [test x$win32_host = xyes])
113
114have_regex=yes
115AC_SEARCH_LIBS([regcomp], [regex],,[have_regex=no])
116AC_SEARCH_LIBS([regexec], [regex],,[have_regex=no])
117AC_SEARCH_LIBS([regfree], [regex],,[have_regex=no])
118AC_SEARCH_LIBS([regerror], [regex],,[have_regex=no])
119AM_CONDITIONAL([HAVE_REGEX], [test x$have_regex = xyes])
120 161
121AC_CHECK_LIB([users],[noobs],,[AC_MSG_NOTICE([No noobs found, disabling hand_holding().])])
122 162
123have_signal=yes 163AC_CHECK_LIB([users],[noobs],,[AC_MSG_NOTICE([No noobs found, disabling hand_holding().])])
124AC_CHECK_HEADERS([signal.h], ,[have_signal=no])
125AC_CHECK_TYPES([sig_t], ,[have_signal=no],[#include <signal.h>])
126AC_SEARCH_LIBS([signal], ,,[have_signal=no])
127AM_CONDITIONAL([HAVE_SIGNAL], [test x$have_signal = xyes])
128 164
129# initiates bindle tools macros 165# initiates bindle tools macros
130AC_BINDLE(contrib/bindletools) 166AC_BINDLE(contrib/bindletools)
@@ -135,6 +171,10 @@ AC_BINDLE_GIT_PACKAGE_VERSION([contrib/bindletools/build-aux/git-package-version
135# custom configure options 171# custom configure options
136AC_BINDLE_ENABLE_WARNINGS 172AC_BINDLE_ENABLE_WARNINGS
137AC_BINDLE_WITH_PERL 173AC_BINDLE_WITH_PERL
174AC_DMS_REGEX
175AC_DMS_SIGNAL
176AC_DMS_WIN32
177
138 178
139# Creates outputs 179# Creates outputs
140AC_CONFIG_FILES([Makefile]) 180AC_CONFIG_FILES([Makefile])