[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] OpenBSD support
From: |
Brad |
Subject: |
[PATCH] OpenBSD support |
Date: |
Wed, 27 Jun 2001 12:23:23 -0400 (EDT) |
Here are patches that apply agains't libtool 1.4 that bring OpenBSD
support up to date.
These changes are also applicable to HEAD and the MLB branches.
BTW, I was looking at the MLB branch and so far I've seen one problem,
ltcf-cxx.sh assumes things can be done in a certain way if it detects GNU
ld and there is no provided "knob" to override this behavior like libtool
1.4 and older and/or ltcf-c.sh which will be needed. Some of our archs use
GNU ld but too old for the detection routine to properly detect it, but
either way the behavior should be the same whether it's using old GNU ld
or new GNU ld (which *requires* an override knob).
// Brad
address@hidden
address@hidden
--- libtool.m4.orig Tue Apr 24 19:34:11 2001
+++ libtool.m4 Wed Jun 20 21:10:03 2001
@@ -1188,7 +1188,9 @@ cygwin* | mingw* | pw32* )
with_gnu_ld=no
fi
;;
-
+openbsd*)
+ with_gnu_ld=no
+ ;;
esac
ld_shlibs=yes
@@ -1592,10 +1594,21 @@ else
;;
openbsd*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs
$linker_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ if [ "`echo __ELF__ | $CC -E - | grep __ELF__`" = "" -o
"$host_os-$host_cpu" = "openbsd2.8-powerpc" ]; then
+ export_dynamic_flag_spec='${wl}-E'
+ fi
+ ;;
+ esac
;;
os2*)
@@ -2081,13 +2094,16 @@ newsos6)
openbsd*)
version_type=sunos
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- need_version=no
- fi
library_names_spec='${libname}${release}.so$versuffix
${libname}.so$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if [ "`echo __ELF__ | $CC -E - | grep __ELF__`" = "" -o "$host_os-$host_cpu"
= "openbsd2.8-powerpc" ]; then
+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ else
+ deplibs_check_method='file_magic OpenBSD.* shared library'
+ fi
;;
os2*)
--- ltmain.in.orig Wed Jun 20 19:52:42 2001
+++ ltmain.in Wed Jun 20 20:03:19 2001
@@ -1031,6 +1031,18 @@ compiler."
# These systems don't actually have a C library (as such)
test "X$arg" = "X-lc" && continue
;;
+ *-*-openbsd*)
+ # Do not include libc due to us having libc/libc_r.
+ continue
+ ;;
+ esac
+ fi
+ if test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
esac
fi
deplibs="$deplibs $arg"
@@ -2408,6 +2420,9 @@ compiler."
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
+ *-*-openbsd*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
*)
# Add libc to deplibs on all other systems if necessary.
if test $build_libtool_need_lc = "yes"; then
- [PATCH] OpenBSD support,
Brad <=