[Date Prev][Date Next] [Chronological] [Thread] [Top]

Problem with tempnam

Hi (I posted this on openldap-bugs but got no respons),

I have problem compiling OpenLDAP 2.0.25-20020618 on i686 Linux (based on RedHat 7.2) with gcc 3.2 . "make" failes with

/pkg-local/gcc/3.2/bin/gcc -g -O2 -I../../include        -I../../include
  -c -o tempnam.o tempnam.c
tempnam.c: In function `tempnam':
tempnam.c:20: `LDAP_TMPDIR' undeclared (first use in this function)
tempnam.c:20: (Each undeclared identifier is reported only once
tempnam.c:20: for each function it appears in.)
make[2]: *** [tempnam.o] Error 1
make[2]: Leaving directory
make[1]: *** [all-common] Error 1
make[1]: Leaving directory
make: *** [all-common] Error 1

Interesting line from "./configure":

    checking for tempnam... no

This is from "config.log":

configure:16931: checking for tempnam
configure:16960: /pkg-local/gcc/3.2/bin/gcc -o conftest -g -O2   conftest.c
-lresolv -ldl  1>&5
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14.
/usr/bin/ld: Dwarf Error: Invalid or unhandled FORM value: 14.
/tmp/ccCVn6VY.o: In function `main':
:16954: the use of `tempnam' is dangerous, better use `mkstemp'
collect2: ld returned 1 exit status
configure: failed program was:
#line 16936 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
   which can conflict with char tempnam(); 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 tempnam();
char (*f)();

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_tempnam) || defined (__stub___tempnam)
choke me
f = tempnam;

; return 0; }
configure:16997: checking declaration of sys_errlist
configure:17016: /pkg-local/gcc/3.2/bin/gcc -c -g -O2  conftest.c 1>&5

Any idea why "make" failes? For me it seems to be a problem with "makenam"
here. Is it possible to solve in some way? Somebody maybe can point out what is missing so I can try to fix it.

       Best regards / Jan

På MSN hittar du det roliga, intressanta och användbara på internet: http://www.msn.se