Closed Bug 118825 Opened 23 years ago Closed 23 years ago

configure change required to set HAVE_FLOCKFILE

Categories

(SeaMonkey :: Build Config, defect, P2)

Other
AIX

Tracking

(Not tracked)

RESOLVED FIXED
mozilla0.9.8

People

(Reporter: jdunn, Assigned: roland.mainz)

Details

Attachments

(4 files, 1 obsolete file)

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 configure.in to check for the existence
of the flockfile stuff and set this define in autoconf.mk's AC_DEFINES.
However, there doesn't seem to be any way of currently setting this
define.

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.
updating target milestone... since this is a build bustage.
Severity: normal → major
Priority: -- → P2
Target Milestone: --- → mozilla0.9.8
Does AIX have flockfile()/funlockfile() ?
yup... aix has this so does HP...
HP however, just flags the redefinition as a warning
Keywords: patch, review
Roland, thanks for taking this.
Assignee: katakai → Roland.Mainz
?!

OKOK, taking... :-)
Status: NEW → ASSIGNED
cls:
Do we have already checks for flockfile()/funlockfile()/getc_unlocked() in
configure.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 configure.in.  
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 configure.in ...
... need help ...
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 configure.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 configure.in to set it!
Another attempt for a quick workaround (I am not a configure.in hacker...
sorry...) ...
Attachment #64022 - Attachment is obsolete: true
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.
hi,

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.in, configure, config.h.in for our use as below:

config.h.in
-----------
/* Define if you have the flockfile function.  */
#undef HAVE_FLOCKFILE

configure
---------
for ac_func in flockfile
do
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
else
  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
#else
$ac_func();
#endif

; return 0; }
EOF
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"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

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
JKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF

else
  echo "$ac_t""no" 1>&6
fi
done

configure.in
------------
AC_CHECK_FUNCS(flockfile)

prabhat.
Comment on attachment 64173 [details] [diff] [review]
configure.in 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
sufficient.
Attachment #64173 - Flags: needs-work+
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+
Attached patch revised diffSplinter Review
Ok, thanks cls, I have updated the patch based on your 
suggestion and am checking it in.  Sorry I didn't see
these before.
fix checked in - THANKS EVERYONE!
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: