Adds support for checking what OS you're using, and adding a -DLINUX if
its linux. In the future it will also help for adding os specific
checks for other things.
Addresses Dave and Jesse's need for -DLINUX for right now. This patch
also has the autoconf/automake reran, which updates the paths for the
sqlheader stuff, this came from today's cvs, so apply this one instead
of the previous patch about updating configure to match configure.in
If you know of something your particular os needs that the standard
configure doesn't show post a reply to this thread.
--
Ryan Butler <[EMAIL PROTECTED]>
ADI Internet Solutions
diff -ur dbmail/Makefile.am dbmail-work/Makefile.am
--- dbmail/Makefile.am Fri Feb 7 13:54:10 2003
+++ dbmail-work/Makefile.am Thu Feb 27 11:15:46 2003
@@ -2,6 +2,7 @@
bin_PROGRAMS = dbmail-smtp dbmail-pop3d dbmail-imapd dbmail-maintenance dbmail-adduser dbmail-readvut raw-convertor dbmail-mini-injector
bin_SCRIPTS = install-dbmail.sh
+AM_CFLAGS = @LINUX@
dbmail_smtp_SOURCES = config.c list.c debug.c dbmd5.c md5.c mime.c main.c pipe.c bounce.c forward.c memblock.c
dbmail_smtp_LDADD = @SQLALIB@
diff -ur dbmail/Makefile.in dbmail-work/Makefile.in
--- dbmail/Makefile.in Fri Feb 7 13:54:10 2003
+++ dbmail-work/Makefile.in Thu Feb 27 11:16:04 2003
@@ -58,6 +58,7 @@
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
+LINUX = @LINUX@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MYSQLINC = @MYSQLINC@
@@ -72,6 +73,7 @@
bin_PROGRAMS = dbmail-smtp dbmail-pop3d dbmail-imapd dbmail-maintenance dbmail-adduser dbmail-readvut raw-convertor dbmail-mini-injector
bin_SCRIPTS = install-dbmail.sh
+AM_CFLAGS = @LINUX@
dbmail_smtp_SOURCES = config.c list.c debug.c dbmd5.c md5.c mime.c main.c pipe.c bounce.c forward.c memblock.c
dbmail_smtp_LDADD = @SQLALIB@
diff -ur dbmail/aclocal.m4 dbmail-work/aclocal.m4
--- dbmail/aclocal.m4 Fri Feb 7 13:54:10 2003
+++ dbmail-work/aclocal.m4 Thu Feb 27 11:04:41 2003
@@ -309,3 +309,15 @@
fi
fi
])
+
+AC_DEFUN(DBMAIL_CHECK_OS, [dnl
+
+AC_CACHE_CHECK(system type, dbmail_system_type, dbmail_system_type=`uname -s`)
+
+if test $dbmail_system_type == "Linux"
+ then
+ AC_MSG_RESULT(You're running Linux! Excellent!)
+ LINUX="-DLINUX"
+fi
+
+])
diff -ur dbmail/configure dbmail-work/configure
--- dbmail/configure Fri Feb 7 13:54:10 2003
+++ dbmail-work/configure Thu Feb 27 11:16:02 2003
@@ -842,19 +842,24 @@
mysqllibpaths="/usr/lib /usr/local/lib /lib /usr/freeware/lib \
- /usr/freeware/lib32 $HOME/lib $HOME/tcl/lib $HOME"
+ /usr/freeware/lib32 $HOME/lib $HOME/mysql/lib \
+ /usr/lib/mysql /usr/local/lib/mysql $HOME/lib/mysql $HOME"
+
mysqlheaderpaths="/usr/include/mysql /usr/include /usr/local/include/mysql \
/usr/local/include /usr/freeware/include/mysql \
/usr/freeware/include $HOME/include $HOME/mysql/include \
$HOME"
pgsqllibpaths="/usr/lib /usr/local/lib /lib /usr/freeware/lib \
- /usr/freeware/lib32 $HOME/lib $HOME/tcl/lib $HOME"
+ /usr/freeware/lib32 $HOME/lib $HOME/pgsql/lib \
+ /usr/lib/pgsql /usr/local/lib/pgsql /usr/lib/postgresql \
+ /usr/local/lib/postgresql $HOME/lib/pgsql $HOME/lib/postgresql \
+ $HOME/postgresql/lib $HOME"
pgsqlheaderpaths="/usr/include/pgsql /usr/include /usr/local/include/pgsql \
/usr/local/include /usr/freeware/include/pgsql \
/usr/freeware/include $HOME/include $HOME/pgsql/include \
- /usr/local/pgsql/include $HOME"
+ /usr/local/pgsql/include /usr/include/postgresql $HOME"
# Check whether --with-mysql or --without-mysql was given.
if test "${with_mysql+set}" = set; then
@@ -917,7 +922,7 @@
if test "$withval" != "yes"
then
echo $ac_n "checking for mysql.h (user supplied)""... $ac_c" 1>&6
-echo "configure:921: checking for mysql.h (user supplied)" >&5
+echo "configure:926: checking for mysql.h (user supplied)" >&5
if test -r "$mysqlheadername/mysql.h"
then
# found
@@ -935,7 +940,7 @@
else
# Lets look in our standard paths
echo $ac_n "checking for mysql.h""... $ac_c" 1>&6
-echo "configure:939: checking for mysql.h" >&5
+echo "configure:944: checking for mysql.h" >&5
for mysqlpaths in $mysqlheaderpaths
do
if test -r "$mysqlpaths/mysql.h"
@@ -962,7 +967,7 @@
if test "$withval" != "yes"
then
echo $ac_n "checking for libpq-fe.h (user supplied)""... $ac_c" 1>&6
-echo "configure:966: checking for libpq-fe.h (user supplied)" >&5
+echo "configure:971: checking for libpq-fe.h (user supplied)" >&5
if test -r "$pgsqlheadername/libpq-fe.h"
then
# found
@@ -980,7 +985,7 @@
else
# Lets look in our standard paths
echo $ac_n "checking for libpq-fe.h""... $ac_c" 1>&6
-echo "configure:984: checking for libpq-fe.h" >&5
+echo "configure:989: checking for libpq-fe.h" >&5
for pgsqlpaths in $pgsqlheaderpaths
do
if test -r "$pgsqlpaths/libpq-fe.h"
@@ -1004,7 +1009,7 @@
if test ! "${mysqlheadername-x}" = "x"
then
echo $ac_n "checking for mysql_real_connect in -lmysqlclient""... $ac_c" 1>&6
-echo "configure:1008: checking for mysql_real_connect in -lmysqlclient" >&5
+echo "configure:1013: checking for mysql_real_connect in -lmysqlclient" >&5
ac_lib_var=`echo mysqlclient'_'mysql_real_connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1012,7 +1017,7 @@
ac_save_LIBS="$LIBS"
LIBS="-lmysqlclient $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1016 "configure"
+#line 1021 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1023,7 +1028,7 @@
mysql_real_connect()
; return 0; }
EOF
-if { (eval echo configure:1027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1055,7 +1060,7 @@
if test ! "${pgsqlheadername-x}" = "x"
then
echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6
-echo "configure:1059: checking for PQconnectdb in -lpq" >&5
+echo "configure:1064: checking for PQconnectdb in -lpq" >&5
ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1063,7 +1068,7 @@
ac_save_LIBS="$LIBS"
LIBS="-lpq $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1067 "configure"
+#line 1072 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1074,7 +1079,7 @@
PQconnectdb()
; return 0; }
EOF
-if { (eval echo configure:1078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1106,10 +1111,28 @@
fi
+echo $ac_n "checking system type""... $ac_c" 1>&6
+echo "configure:1116: checking system type" >&5
+if eval "test \"`echo '$''{'dbmail_system_type'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ dbmail_system_type=`uname -s`
+fi
+
+echo "$ac_t""$dbmail_system_type" 1>&6
+
+if test $dbmail_system_type == "Linux"
+ then
+ echo "$ac_t""You're running Linux! Excellent!" 1>&6
+ LINUX="-DLINUX"
+fi
+
+
+
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1113: checking for $ac_word" >&5
+echo "configure:1136: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1139,7 +1162,7 @@
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1143: checking for $ac_word" >&5
+echo "configure:1166: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1190,7 +1213,7 @@
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1194: checking for $ac_word" >&5
+echo "configure:1217: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1222,7 +1245,7 @@
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1226: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1249: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1233,12 +1256,12 @@
cat > conftest.$ac_ext << EOF
-#line 1237 "configure"
+#line 1260 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1264,12 +1287,12 @@
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1268: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1291: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1273: checking whether we are using GNU C" >&5
+echo "configure:1296: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1278,7 +1301,7 @@
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1297,7 +1320,7 @@
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1301: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1324: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1329,12 +1352,12 @@
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1333: checking for working const" >&5
+echo "configure:1356: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1338 "configure"
+#line 1361 "configure"
#include "confdefs.h"
int main() {
@@ -1383,7 +1406,7 @@
; return 0; }
EOF
-if { (eval echo configure:1387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1404,21 +1427,21 @@
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1408: checking for inline" >&5
+echo "configure:1431: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1415 "configure"
+#line 1438 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1466,6 +1489,7 @@
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
@@ -1635,6 +1659,7 @@
[EMAIL PROTECTED]@%$SQLALIB%g
[EMAIL PROTECTED]@%$MYSQLINC%g
[EMAIL PROTECTED]@%$PGSQLINC%g
[EMAIL PROTECTED]@%$LINUX%g
CEOF
EOF
diff -ur dbmail/configure.in dbmail-work/configure.in
--- dbmail/configure.in Sat Feb 15 10:56:46 2003
+++ dbmail-work/configure.in Thu Feb 27 11:07:59 2003
@@ -28,6 +28,7 @@
DBMAIL_BOTH_SQL_CHECK
DBMAIL_CHECK_SQL_LIBS
+DBMAIL_CHECK_OS
AC_PROG_CC
AC_C_CONST
@@ -39,4 +40,5 @@
AC_SUBST(SQLALIB)
AC_SUBST(MYSQLINC)
AC_SUBST(PGSQLINC)
+AC_SUBST(LINUX)
AC_OUTPUT(Makefile mysql/Makefile pgsql/Makefile)
diff -ur dbmail/mysql/Makefile.am dbmail-work/mysql/Makefile.am
--- dbmail/mysql/Makefile.am Fri Jul 26 16:03:46 2002
+++ dbmail-work/mysql/Makefile.am Thu Feb 27 11:05:37 2003
@@ -1,5 +1,5 @@
if MYSQL
-AM_CFLAGS = -I @MYSQLINC@
+AM_CFLAGS = @LINUX@ -I @MYSQLINC@
lib_LIBRARIES = libmysqldbmail.a
diff -ur dbmail/mysql/Makefile.in dbmail-work/mysql/Makefile.in
--- dbmail/mysql/Makefile.in Fri Jul 26 16:22:43 2002
+++ dbmail-work/mysql/Makefile.in Thu Feb 27 11:16:04 2003
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -58,6 +58,7 @@
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
+LINUX = @LINUX@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MYSQLINC = @MYSQLINC@
@@ -68,11 +69,12 @@
SQLLIB = @SQLLIB@
VERSION = @VERSION@
[EMAIL PROTECTED]@AM_CFLAGS = -I @MYSQLINC@
[EMAIL PROTECTED]@AM_CFLAGS = @MYSQL_TRUE@@LINUX@ -I @MYSQLINC@
[EMAIL PROTECTED]@lib_LIBRARIES = libmysqldbmail.a
[EMAIL PROTECTED]@lib_LIBRARIES = @[EMAIL PROTECTED]
[EMAIL PROTECTED]@libmysqldbmail_a_SOURCES = dbauthmysql.c dbmysql.c dbmsgbufmysql.c dbsearchmysql.c
[EMAIL PROTECTED]@libmysqldbmail_a_SOURCES = @[EMAIL PROTECTED] dbmysql.c dbmsgbufmysql.c \
[EMAIL PROTECTED]@ dbsearchmysql.c
mkinstalldirs = $(SHELL) $(top_srcdir)/buildtools/mkinstalldirs
CONFIG_CLEAN_FILES =
LIBRARIES = $(lib_LIBRARIES)
@@ -95,7 +97,7 @@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
DEP_FILES = .deps/dbauthmysql.P .deps/dbmsgbufmysql.P .deps/dbmysql.P \
.deps/dbsearchmysql.P
diff -ur dbmail/pgsql/Makefile.am dbmail-work/pgsql/Makefile.am
--- dbmail/pgsql/Makefile.am Fri Jul 26 16:03:46 2002
+++ dbmail-work/pgsql/Makefile.am Thu Feb 27 11:05:55 2003
@@ -1,5 +1,5 @@
if PGSQL
-AM_CFLAGS = -I @PGSQLINC@
+AM_CFLAGS = @LINUX@ -I @PGSQLINC@
lib_LIBRARIES = libpgsqldbmail.a
libpgsqldbmail_a_SOURCES = dbauthpgsql.c dbpgsql.c dbmsgbufpgsql.c dbsearchpgsql.c
endif
diff -ur dbmail/pgsql/Makefile.in dbmail-work/pgsql/Makefile.in
--- dbmail/pgsql/Makefile.in Fri Jul 26 16:22:43 2002
+++ dbmail-work/pgsql/Makefile.in Thu Feb 27 11:16:04 2003
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -58,6 +58,7 @@
PRE_UNINSTALL = :
POST_UNINSTALL = :
CC = @CC@
+LINUX = @LINUX@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MYSQLINC = @MYSQLINC@
@@ -68,9 +69,9 @@
SQLLIB = @SQLLIB@
VERSION = @VERSION@
[EMAIL PROTECTED]@AM_CFLAGS = -I @PGSQLINC@
[EMAIL PROTECTED]@lib_LIBRARIES = libpgsqldbmail.a
[EMAIL PROTECTED]@libpgsqldbmail_a_SOURCES = dbauthpgsql.c dbpgsql.c dbmsgbufpgsql.c dbsearchpgsql.c
[EMAIL PROTECTED]@AM_CFLAGS = @PGSQL_TRUE@@LINUX@ -I @PGSQLINC@
[EMAIL PROTECTED]@lib_LIBRARIES = @[EMAIL PROTECTED]
[EMAIL PROTECTED]@libpgsqldbmail_a_SOURCES = @[EMAIL PROTECTED] dbpgsql.c dbmsgbufpgsql.c dbsearchpgsql.c
mkinstalldirs = $(SHELL) $(top_srcdir)/buildtools/mkinstalldirs
CONFIG_CLEAN_FILES =
LIBRARIES = $(lib_LIBRARIES)
@@ -93,7 +94,7 @@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = tar
+TAR = gtar
GZIP_ENV = --best
DEP_FILES = .deps/dbauthpgsql.P .deps/dbmsgbufpgsql.P .deps/dbpgsql.P \
.deps/dbsearchpgsql.P