build: added getpass() tests
authorAndrew Tridgell <tridge@samba.org>
Sun, 7 Mar 2010 13:40:58 +0000 (00:40 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:46 +0000 (20:26 +1000)
lib/replace/wscript

index 9312db4ac0596b1abc39289610393eaf5a692e84..a7955a699265bf85dcc53d3ebee2c60ed26f5242 100644 (file)
@@ -261,6 +261,18 @@ def configure(conf):
                         cflags=conf.env.VISIBILITY_CFLAGS,
                         define='HAVE_VISIBILITY_ATTR')
 
+    # use this later ->  conf.recurse('.', name='getpass')
+
+    if conf.CHECK_FUNCS('getpass getpassphrase'):
+        # if we have both, then we prefer getpassphrase
+        conf.DEFINE(REPLACE_GETPASS_BY_GETPASSPHRASE, 1)
+        conf.DEFINE(REPLACE_GETPASS, 1)
+
+    conf.CHECK_CODE('''#include "getpass.c"
+                       int main(void) { return 0; }''',
+                    addmain=False,
+                    define='REPLACE_GETPASS',
+                    cflags='-DNO_CONFIG_H')
 
 def build(bld):
     bld.set_rpath()