Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Ocaml in RedHat 7.0 #2594

Closed
vicuna opened this issue Oct 24, 2000 · 3 comments
Closed

Compiling Ocaml in RedHat 7.0 #2594

vicuna opened this issue Oct 24, 2000 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Oct 24, 2000

Original bug ID: 209
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Stephanie Weirich
Version: 3.00 (and 2.04)
OS: redhat 7.0
Submission from: dhcp98-104.cs.cornell.edu (128.84.98.104)

I tried to compile the sources to ocaml 3.00 on my newly installed
redhat 7.0 box. I used the standard configuration (from ./configure), and make
world
produces the error:

make[1]: Entering directory /root/ocaml-3.00/otherlibs/unix' gcc -I../../byterun -O -fno-defer-pop -Wall -Wno-unused -c -o accept.o accept. c In file included from /usr/include/sys/un.h:25, from socketaddr.h:19, from accept.c:24: /usr/include/string.h:245: parse error before ('
/usr/include/string.h:245: conflicting types for memmove' /usr/include/string.h:42: previous declaration of memmove'
/usr/include/string.h:245: parse error before `__const'
make[1]: *** [accept.o] Error 1

@vicuna
Copy link
Author

vicuna commented Oct 24, 2000

Comment author: administrator

I tried to compile the sources to ocaml 3.00 on my newly installed
redhat 7.0 box.

Yep. Has to do with new glibc. Here is an unofficial patch (to config.h)
Also, if you attempt to compile ocamltk416 you will hit another configuration
problem; attached is also a new configure.in for ocamltk416


dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which in turn produces the files
dnl "Makefile.config" and "Makefile.camltk".
dnl If you don't have autoconf installed, simply use the "configure"
dnl script.
dnl Usage:
dnl $ autoconf configure.in > configure
dnl edit site.config
dnl $ ./configure -with-config=site.config
dnl NOTE: autoconf 2.4 CHOKES on this. Use a newer version (e.g 2.7).

dnl This is the file that must exist in srcdir
AC_INIT(Widgets.src)

dnl Rather use gcc
AC_PROG_CC
AC_HAVE_HEADERS(unistd.h limits.h)

dnl Defaults for variables, overriden in site.config
LIBEXT=
INSTALLDIR='$(LIBDIR)/camltk'

dnl We need locations in the first place
AC_ARG_WITH(config,
[ --with-config=Site specific locations of various software. Check the INSTALL instructions],
if test -f $withval; then
SITECFG=$withval
. $withval
else
AC_MSG_ERROR($withval does not exist)
fi,
AC_MSG_ERROR(
You must provide a file giving the location of various software using the option --with-config=file. Check the INSTALL instructions))

if test -z "$OCAMLLIBDIR"; then
AC_MSG_ERROR("OCAMLLIBDIR is still undefined. Edit $SITECFG")
fi

dnl builtin rule for X
AC_PATH_XTRA
WITH_X="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"

dnl builtin rule for ranlib
AC_PROG_RANLIB

dnl As soon as we use this, we must have install-sh available. Damn.
dnl AC_CANONICAL_HOST

LIBS="-lm"

We probably need more

AC_CHECK_LIB(dl, dlopen, LIBS="-ldl $LIBS")

Check for Tcl7.5(7.6) and Tk4.1(4.2)

AC_MSG_CHECKING(Tcl and Tk includes and libraries)

AC_CHECK_HEADERS(tcl.h,,
AC_MSG_ERROR(Can't find tcl.h. Check the CPPFLAGS variable in $SITECFG))

AC_CHECK_HEADERS(tk.h,,
AC_MSG_ERROR(Can't find tk.h. Check the CPPFLAGS variable in $SITECFG))

tcl75="tcl75$LIBEXT"
tcl75d="tcl7.5$LIBEXT"
tcl76="tcl76$LIBEXT"
tcl76d="tcl7.6$LIBEXT"
tcl80="tcl80$LIBEXT"
tcl80d="tcl8.0$LIBEXT"
tcl83="tcl83$LIBEXT"
tcl83d="tcl8.3$LIBEXT"

dnl We use Tcl_GetFile to be sure to get version >= 7.5
dnl But for 8.0, it doesn't work anymore. Use Tcl_GetObjResult.
dnl This still fails if tcl.so and tk.so are for 8.0.
dnl use X_EXTRA_LIBS to get -lnsl and -lsocket on Solaris
AC_CHECK_LIB($tcl83, Tcl_GetObjResult, LIBS="-l$tcl83 $LIBS",
AC_CHECK_LIB($tcl83d, Tcl_GetObjResult, LIBS="-l$tcl83d $LIBS",
AC_CHECK_LIB($tcl80, Tcl_GetObjResult, LIBS="-l$tcl80 $LIBS",
AC_CHECK_LIB($tcl80d, Tcl_GetObjResult, LIBS="-l$tcl80d $LIBS",
AC_CHECK_LIB($tcl76, Tcl_GetFile, LIBS="-l$tcl76 $LIBS",
AC_CHECK_LIB($tcl76d, Tcl_GetFile, LIBS="-l$tcl76d $LIBS",
AC_CHECK_LIB($tcl75, Tcl_GetFile, LIBS="-l$tcl75 $LIBS",
AC_CHECK_LIB($tcl75d, Tcl_GetFile, LIBS="-l$tcl75d $LIBS",
AC_CHECK_LIB(tcl$LIBEXT, Tcl_GetFile, LIBS="-ltcl$LIBEXT $LIBS",
AC_MSG_ERROR(Can't find a tcl library.
Check config.log to see what happened, and try setting LDFLAGS in $SITECFG),
$X_EXTRA_LIBS -lm),
$X_EXTRA_LIBS -lm),
$X_EXTRA_LIBS -lm),
$X_EXTRA_LIBS -lm),
$X_EXTRA_LIBS -lm),
$X_EXTRA_LIBS -lm),
$X_EXTRA_LIBS -lm),
$X_EXTRA_LIBS -lm),
$X_EXTRA_LIBS -lm)

tk83="tk83$LIBEXT"
tk83d="tk8.3$LIBEXT"
tk80="tk80$LIBEXT"
tk80d="tk8.0$LIBEXT"
tk42="tk42$LIBEXT"
tk42d="tk4.2$LIBEXT"
tk41="tk41$LIBEXT"
tk41d="tk4.1$LIBEXT"

dnl We use Tk_SetGrid to be sure to get version >= 4.1
dnl X_CFLAGS is need if includes are not in /usr/include/X11
AC_CHECK_LIB($tk83, Tk_SetGrid, LIBS="-l$tk83 $LIBS",
AC_CHECK_LIB($tk83d, Tk_SetGrid, LIBS="-l$tk83d $LIBS",
AC_CHECK_LIB($tk80, Tk_SetGrid, LIBS="-l$tk80 $LIBS",
AC_CHECK_LIB($tk80d, Tk_SetGrid, LIBS="-l$tk80d $LIBS",
AC_CHECK_LIB($tk42, Tk_SetGrid, LIBS="-l$tk42 $LIBS",
AC_CHECK_LIB($tk42d, Tk_SetGrid, LIBS="-l$tk42d $LIBS",
AC_CHECK_LIB($tk41, Tk_SetGrid, LIBS="-l$tk41 $LIBS",
AC_CHECK_LIB($tk41d, Tk_SetGrid, LIBS="-l$tk41d $LIBS",
AC_CHECK_LIB(tk$LIBEXT, Tk_SetGrid, LIBS="-ltk$LIBEXT $LIBS",
AC_MSG_ERROR(Can't find a tk library.
Check config.log to see what happened, and try setting LDFLAGS in $SITECFG),
$X_CFLAGS $WITH_X -lm),
$X_CFLAGS $WITH_X -lm),
$X_CFLAGS $WITH_X -lm),
$X_CFLAGS $WITH_X -lm),
$X_CFLAGS $WITH_X -lm),
$X_CFLAGS $WITH_X -lm),
$X_CFLAGS $WITH_X -lm),
$X_CFLAGS $WITH_X -lm),
$X_CFLAGS $WITH_X -lm)

dnl This is the file that we produce
dnl These are the variables that are substituted in Makefile.config.in to
dnl produce Makefile.config

dnl The OCaml library
AC_SUBST(OCAMLLIBDIR)

dnl Install dir
AC_SUBST(INSTALLDIR)

dnl Info collected about X
dnl The includes and options
AC_SUBST(X_CFLAGS)

dnl The libraries
dnl special trick to substitute -L and -l ...
dnl All options (for cc compilation)
AC_SUBST(WITH_X)
dnl X link options
AC_SUBST(X_LIBS)
THE_X_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
AC_SUBST(THE_X_LIBS)

dnl Tcl/Tk
dnl CPPFLAGS, LIBS and LDFLAGS are substituted by default

dnl Info collected about ranlib
AC_SUBST(RANLIB)
dnl LIBS is subsituted by default
AC_OUTPUT(Makefile.config Makefile.camltk tkanim/ext/Makefile)


*** config.h Sat Oct 14 01:16:37 2000
--- config.h~ Wed Apr 5 11:30:11 2000


*** 56,65 ****
/* Library dependencies */

#ifdef HAS_MEMMOVE

  • #ifndef HAS_BCOPY
    #undef bcopy
    #define bcopy(src,dst,len) memmove((dst), (src), (len))
  • #endif
    #else
    #ifdef HAS_BCOPY
    /* Nothing to do */
    --- 56,63 ----


@vicuna
Copy link
Author

vicuna commented Oct 24, 2000

Comment author: administrator

Thanks. That fixed my problem.

Stephanie

-----Original Message-----
From: Damien Doligez [mailto:caml-bugs@pauillac.inria.fr]
Sent: Tuesday, October 24, 2000 12:21 PM
To: sweirich@CS.Cornell.EDU
Subject: Re: Compiling Ocaml in RedHat 7.0 (#2594)

I tried to compile the sources to ocaml 3.00 on my newly installed
redhat 7.0 box. I used the standard configuration (from
./configure), and
make
world
produces the error:
[...]
/usr/include/string.h:245: conflicting types for memmove' /usr/include/string.h:42: previous declaration of memmove'

This is a bug in O'Caml 3.00. It will be fixed in the next release.

In the meantime, you can work around this bug by removing
the two lines after "#ifdef HAS_MEMMOVE" from the file
byterun/config.h. These are lines 59 and 60, and they look like this:

#undef bcopy
#define bcopy(src,dst,len) memmove((dst), (src), (len))

Thanks for the report,

-- Damien

@vicuna
Copy link
Author

vicuna commented Oct 24, 2000

Comment author: administrator

I tried to compile the sources to ocaml 3.00 on my newly installed
redhat 7.0 box. I used the standard configuration (from ./configure), and
make
world
produces the error:
[...]
/usr/include/string.h:245: conflicting types for memmove' /usr/include/string.h:42: previous declaration of memmove'

This is a bug in O'Caml 3.00. It will be fixed in the next release.

In the meantime, you can work around this bug by removing
the two lines after "#ifdef HAS_MEMMOVE" from the file
byterun/config.h. These are lines 59 and 60, and they look like this:

#undef bcopy
#define bcopy(src,dst,len) memmove((dst), (src), (len))

Thanks for the report,

-- Damien

@vicuna vicuna closed this as completed Oct 24, 2000
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant