]> diplodocus.org Git - nmh/commitdiff
Ensure getline() is in scope on FreeBSD.
authorLyndon Nerenberg <lyndon@orthanc.ca>
Mon, 16 Jun 2014 23:03:25 +0000 (16:03 -0700)
committerLyndon Nerenberg <lyndon@orthanc.ca>
Mon, 16 Jun 2014 23:03:25 +0000 (16:03 -0700)
On FreeBSD, to make the getline() prototype visible, you must
'#define _WITH_GETLINE' before including <stdio.h>.

configure.ac

index a4caa82f50da55a5ec5289e07cae9298c5dfe726..4fc486e9c12a43ea9d327fa9918f8ba63430ae7f 100644 (file)
@@ -153,6 +153,12 @@ if test -n "$auto_cflags"; then
   test "$nmh_cv_has_wextra" = "yes"  &&  CFLAGS="${CFLAGS:+$CFLAGS }-Wextra"
 fi
 
   test "$nmh_cv_has_wextra" = "yes"  &&  CFLAGS="${CFLAGS:+$CFLAGS }-Wextra"
 fi
 
+dnl FreeBSD needs a bit of magic to bring getline() into scope.
+dnl We do this here rather than in (say) h/mh.h because this macro must
+dnl be defined before <stdio.h> is pulled in.
+AS_IF([test `uname` = FreeBSD],
+       [CPPFLAGS="$CPPFLAGS -D_WITH_GETLINE"])
+
 dnl --------------
 dnl CUSTOMIZE LINK
 dnl --------------
 dnl --------------
 dnl CUSTOMIZE LINK
 dnl --------------