summaryrefslogtreecommitdiff
path: root/mcon/U/i_ndbm.U
diff options
context:
space:
mode:
authorrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2010-11-27 11:55:39 +0000
committerrmanfredi <rmanfredi@2592e710-e01b-42a5-8df0-11608a6cc53d>2010-11-27 11:55:39 +0000
commit13158f86e3904284dce3dad36b64f07414459551 (patch)
tree12cc7b8d1b808c8c3505bb44cf067bd9ab98b1e6 /mcon/U/i_ndbm.U
parent194d1db97053d853d5f81c362c461d71c05ea80e (diff)
Applied mega patch from Christian Biere to greatly improve feature detection
and make a huge step towards better support for cross-compiling. git-svn-id: svn://svn.code.sf.net/p/dist/code/trunk/dist@34 2592e710-e01b-42a5-8df0-11608a6cc53d
Diffstat (limited to 'mcon/U/i_ndbm.U')
-rw-r--r--mcon/U/i_ndbm.U34
1 files changed, 15 insertions, 19 deletions
diff --git a/mcon/U/i_ndbm.U b/mcon/U/i_ndbm.U
index 8b7eda4..704cbba 100644
--- a/mcon/U/i_ndbm.U
+++ b/mcon/U/i_ndbm.U
@@ -15,7 +15,7 @@
?RCS: Revision 3.0 1993/08/18 12:08:23 ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
-?MAKE:i_ndbm: Inhdr Inlibc Setvar
+?MAKE:i_ndbm: Inhdr Trylink Setvar cat
?MAKE: -pick add $@ %<
?S:i_ndbm (d_ndbm):
?S: This variable conditionally defines the I_NDBM symbol, which
@@ -28,26 +28,22 @@
?C:.
?H:#$i_ndbm I_NDBM /**/
?H:.
-?T:t_ndbm d_dbm_open
+?T:d_dbm_open
?LINT:set i_ndbm
: see if ndbm.h is available
-?X: t_ndbm is a tentative check. We might just have the .h, not the lib -- ADO
-set ndbm.h t_ndbm
-eval $inhdr
-case "$t_ndbm" in
-$define)
- : see if dbm_open exists
- set dbm_open d_dbm_open
- eval $inlibc
- case "$d_dbm_open" in
- $undef)
- t_ndbm="$undef"
- echo "We won't be including <ndbm.h>"
- ;;
- esac
- ;;
-esac
-val="$t_ndbm"
+$cat >try.c <<EOC
+#include <ndbm.h>
+int main(void)
+{
+ static DBM *dbm;
+ dbm = dbm_open("file", 1, 2);
+ return dbm ? 0 : 1;
+}
+EOC
+set d_dbm_open
+eval $trylink
+
+val="$d_dbm_open"
set i_ndbm
eval $setvar