configure change required to set HAVE_FLOCKFILE

RESOLVED FIXED in mozilla0.9.8


17 years ago
14 years ago


(Reporter: jdunn, Assigned: roland.mainz)



Firefox Tracking Flags

(Not tracked)



(4 attachments, 1 obsolete attachment)



17 years ago
extensions/ctl/src/pangoLite/pango-util.c has an ifdef in it
for HAVE_FLOCKFILE which if not set defines getc_unlocked
and a couple of other functions.  

AIX already defines getc_unlocked in stdio.h so when it gets
to this line (HAVE_FLOCKFILE is not set) the build stops
with a redefinition error.

There should be a test in to check for the existence
of the flockfile stuff and set this define in's AC_DEFINES.
However, there doesn't seem to be any way of currently setting this

Since this pangoLite is turned on with --enable-extensions=all
this needs to be rectified, programatically, OR this extension
should be removed till it can be.

Comment 1

17 years ago
updating target milestone... since this is a build bustage.
Severity: normal → major
Priority: -- → P2
Target Milestone: --- → mozilla0.9.8

Comment 2

17 years ago
Does AIX have flockfile()/funlockfile() ?

Comment 3

17 years ago
yup... aix has this so does HP...
HP however, just flags the redefinition as a warning

Comment 4

17 years ago
Created attachment 64022 [details] [diff] [review]
Workaround which uses |#undef getc_unlocked|


17 years ago
Keywords: patch, review

Comment 5

17 years ago
Roland, thanks for taking this.
Assignee: katakai → Roland.Mainz

Comment 6

17 years ago

OKOK, taking... :-)

Comment 7

17 years ago
Do we have already checks for flockfile()/funlockfile()/getc_unlocked() in which set a CPP-symbol which may be used to determinate whether the
platforms supports them or not ?
As a quick grep will show, we do not have any checks for flockfile, funlockfile
nor getc_unlocked in  

Comment 9

17 years ago
Can someone check-in attachment 64022 [details] [diff] [review] to fix the build bustage - and then we
need a matching check for flockfile()-API in ...
... need help ...

Comment 10

17 years ago
you can't undef getc_unlocked, since it isn't a define
it is a function prototype...  we need to come up with
the HAVE_FLOCKFILE define in

I am planning on looking at this... however my point is
that if someone went to the trouble to actually put
an ifdef HAVE_FLOCKFILE in the code... then SOMEONE
should have put the code in to set it!

Comment 11

17 years ago
Created attachment 64133 [details] [diff] [review]
Workaround which sets |HAVE_FLOCKFILE| on AIX

Another attempt for a quick workaround (I am not a hacker...
sorry...) ...
Attachment #64022 - Attachment is obsolete: true

Comment 12

17 years ago
Created attachment 64173 [details] [diff] [review] change to set HAVE_FLOCKFILE

cls here is a patch, I think it can be made better (should I be using
AC_CACHE_CHECK???) but this seems to work.  NOTE: I tried this on HP, Linux &
AIX, and all 3 have flockfile.	I don't have a system that doesn't, so can't
check the negative case.

Comment 13

17 years ago

Afraid i am not a configure expert myself. However, simple suggestion. Since
pangolite comes from pango(.org), it must be possible to yank the appropriate
checks in pango's, configure, for our use as below:
/* Define if you have the flockfile function.  */

for ac_func in flockfile
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:7510: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
  cat > conftest.$ac_ext <<EOF
#line 7515 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me

; return 0; }
if { (eval echo configure:7538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } &&
test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
rm -f conftest*

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHI
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1

  echo "$ac_t""no" 1>&6

Comment on attachment 64173 [details] [diff] [review] change to set HAVE_FLOCKFILE

The AC_CHECK_FUNCS macro will do that testing & set HAVE_<functionname> for
you.  Just adding flockfile to the existing AC_CHECK_FUNCS macros should be
Attachment #64173 - Flags: needs-work+

Comment 15

17 years ago
Created attachment 64282 [details] [diff] [review]
New diff based on everyone's input

Ok, looks like AC_CHECK_FUNCS(flockfile) does it.

cls  r=???
Comment on attachment 64282 [details] [diff] [review]
New diff based on everyone's input

Sorry, I was a bit quick with that.  Just add it to the existing AC_CHECK_FUNCS
on lines 1854 && 1855 .
Attachment #64282 - Flags: needs-work+

Comment 18

17 years ago
Created attachment 64290 [details] [diff] [review]
revised diff

Ok, thanks cls, I have updated the patch based on your 
suggestion and am checking it in.  Sorry I didn't see
these before.

Comment 19

17 years ago
fix checked in - THANKS EVERYONE!
Last Resolved: 17 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.