Bug #76044 [NEW]: 'date: illegal option -- -' in ./configure on FreeBSD

From: Date: Fri, 02 Mar 2018 14:40:55 +0000
Subject: Bug #76044 [NEW]: 'date: illegal option -- -' in ./configure on FreeBSD
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214182@lists.php.net to get a copy of this message
From: mgorny at gentoo dot org Operating system: Gentoo/FreeBSD 11.1 PHP version: master-Git-2018-03-02 (Git) Package: *Compile Issues Bug Type: Bug Bug description:'date: illegal option -- -' in ./configure on FreeBSD Description: ------------ When running the configure script, I see the following error message from underlying tools: Configuring TSRM checking for stdarg.h... (cached) yes checking for sigprocmask... (cached) yes checking how many arguments gethostbyname_r() takes... (cached) six date: illegal option -- - usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] Apparently, the following code uses GNU-specific 'date' tool syntax that does not work on *BSD (FWICS, it also won't work on MacOS X): PHP_BUILD_DATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d` The *BSD version of 'date' does not support long options at all. The following would work for the current date: PHP_BUILD_DATE=date -u +%Y-%m-%d However, I don't know of any portable replacement for --date. FWICS, the *BSD version has '-r' option that takes UNIX epoch timestamp but the GNU version uses '-r' for something else. One possible option would be to replace SOURCE_DATE_EPOCH with verbatim Y-m-d date, and use e.g.: PHP_BUILD_DATE=${SOURCE_DATE:-$(date -u +%Y-%m-%d)} -- Edit bug report at https://bugs.php.net/bug.php?id=76044&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76044&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76044&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76044&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76044&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76044&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76044&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76044&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76044&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76044&r=support Expected behavior: https://bugs.php.net/fix.php?id=76044&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76044&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76044&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76044&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76044&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76044&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76044&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76044&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76044&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76044&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76044&r=mysqlcfg

« previous php.bugs (#214182) next »