revert libtool changes; ugly but it builds at least

This commit is contained in:
naddy 2001-09-26 14:18:23 +00:00
parent 07a78e7a1e
commit af524760b5
3 changed files with 4 additions and 453 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.8 2001/08/31 20:24:54 naddy Exp $
# $OpenBSD: Makefile,v 1.9 2001/09/26 14:18:23 naddy Exp $
COMMENT= "free lossless audio codec"
COMMENT-xmms= "XMMS input plugin for playing FLAC files"
@ -31,6 +31,7 @@ LIB_DEPENDS+= xmms.2::audio/xmms
BUILD_DEPENDS+= nasm::devel/nasm
.endif
USE_LIBTOOL= Yes # included libtool is broken
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= ${CONFIGURE_SHARED} --enable-static
@ -43,6 +44,8 @@ DOCDIR= ${PREFIX}/share/doc/flac
post-extract:
@rm -rf ${WRKSRC}/obj
# configure ignores LIBTOOL
@cd ${LOCALBASE}/share/libtool && cp ltconfig ltmain.sh ${WRKSRC}
post-install:
${INSTALL_DATA_DIR} ${DOCDIR}

View File

@ -1,81 +0,0 @@
$OpenBSD: patch-ltconfig,v 1.4 2001/08/31 20:24:54 naddy Exp $
--- ltconfig.orig Fri Aug 31 21:26:13 2001
+++ ltconfig Fri Aug 31 21:38:34 2001
@@ -501,7 +501,14 @@ fi
if test -n "$RANLIB"; then
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ case "$host_os" in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
fi
# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
@@ -1105,7 +1112,9 @@ cygwin* | mingw*)
with_gnu_ld=no
fi
;;
-
+openbsd*)
+ with_gnu_ld=no
+ ;;
esac
ld_shlibs=yes
@@ -1402,10 +1411,21 @@ else
;;
openbsd*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
- 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 test "`echo __ELF__ | $CC -E - | grep __ELF__`" = "" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ export_dynamic_flag_spec='${wl}-E'
+ fi
+ ;;
+ esac
;;
os2*)
@@ -2021,9 +2041,23 @@ netbsd*)
openbsd*)
version_type=sunos
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- need_version=no
+ need_lib_prefix=no
+ need_version=no
+ file_magic_cmd=/usr/bin/file
+ file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test "`echo __ELF__ | $CC -E - | grep __ELF__`" = "" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ case "$host_os" in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ deplibs_check_method='file_magic OpenBSD.* shared library'
+ shlibpath_overrides_runpath=yes
fi
library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'

View File

@ -1,371 +0,0 @@
$OpenBSD: patch-ltmain_sh,v 1.3 2001/08/31 20:24:54 naddy Exp $
--- ltmain.sh.orig Sat Jul 21 00:14:16 2001
+++ ltmain.sh Fri Aug 31 22:06:52 2001
@@ -459,7 +459,7 @@ if test -z "$show_help"; then
pic_mode=default
;;
esac
- if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
# non-PIC code in shared libraries is not supported
pic_mode=default
fi
@@ -1031,12 +1031,27 @@ 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.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "$arg" = "-lc_r"; then
+ case "$host" in
+ *-*-openbsd*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
esac
fi
deplibs="$deplibs $arg"
continue
;;
+ -?thread)
+ deplibs="$deplibs $arg"
+ ;;
+
-module)
module=yes
continue
@@ -1343,7 +1358,7 @@ compiler."
;;
esac
for pass in $passes; do
- if test $linkmode = prog; then
+ if test "$linkmode" = prog; then
# Determine which files to process
case $pass in
dlopen)
@@ -1360,11 +1375,11 @@ compiler."
found=no
case $deplib in
-l*)
- if test $linkmode = oldlib && test $linkmode = obj; then
+ if test "$linkmode" = oldlib && test "$linkmode" = obj; then
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
continue
fi
- if test $pass = conv; then
+ if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
@@ -1384,7 +1399,7 @@ compiler."
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
- test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
@@ -1393,16 +1408,16 @@ compiler."
case $linkmode in
lib)
deplibs="$deplib $deplibs"
- test $pass = conv && continue
+ test "$pass" = conv && continue
newdependency_libs="$deplib $newdependency_libs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;;
prog)
- if test $pass = conv; then
+ if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
- if test $pass = scan; then
+ if test "$pass" = scan; then
deplibs="$deplib $deplibs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
else
@@ -1417,7 +1432,7 @@ compiler."
continue
;; # -L
-R*)
- if test $pass = link; then
+ if test "$pass" = link; then
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
@@ -1430,7 +1445,7 @@ compiler."
;;
*.la) lib="$deplib" ;;
*.$libext)
- if test $pass = conv; then
+ if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
@@ -1451,7 +1466,7 @@ compiler."
continue
;;
prog)
- if test $pass != link; then
+ if test "$pass" != link; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
@@ -1462,7 +1477,7 @@ compiler."
esac # linkmode
;; # *.$libext
*.lo | *.$objext)
- if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
newdlprefiles="$newdlprefiles $deplib"
@@ -1512,13 +1527,13 @@ compiler."
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
- { test $linkmode = oldlib && test $linkmode = obj; }; then
+ { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then
# Add dl[pre]opened files of deplib
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
fi
- if test $pass = conv; then
+ if test "$pass" = conv; then
# Only check for convenience libraries
deplibs="$lib $deplibs"
if test -z "$libdir"; then
@@ -1537,7 +1552,7 @@ compiler."
esac
tmp_libs="$tmp_libs $deplib"
done
- elif test $linkmode != prog && test $linkmode != lib; then
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
$echo "$modename: \`$lib' is not a convenience library" 1>&2
exit 1
fi
@@ -1555,7 +1570,7 @@ compiler."
fi
# This library was specified with -dlopen.
- if test $pass = dlopen; then
+ if test "$pass" = dlopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
exit 1
@@ -1604,7 +1619,7 @@ compiler."
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
# This library was specified with -dlpreopen.
- if test $pass = dlpreopen; then
+ if test "$pass" = dlpreopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
exit 1
@@ -1623,7 +1638,7 @@ compiler."
if test -z "$libdir"; then
# Link the convenience library
- if test $linkmode = lib; then
+ if test "$linkmode" = lib; then
deplibs="$dir/$old_library $deplibs"
elif test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
@@ -1634,7 +1649,7 @@ compiler."
continue
fi
- if test $linkmode = prog && test $pass != link; then
+ if test "$linkmode" = prog && test "$pass" != link; then
newlib_search_path="$newlib_search_path $ladir"
deplibs="$lib $deplibs"
@@ -1671,7 +1686,7 @@ compiler."
# Link against this shared library
if test "$linkmode,$pass" = "prog,link" ||
- { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
+ { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
@@ -1693,7 +1708,7 @@ compiler."
esac
;;
esac
- if test $linkmode = prog; then
+ if test "$linkmode" = prog; then
# We need to hardcode the library path
if test -n "$shlibpath_var"; then
# Make sure the rpath contains only unique directories.
@@ -1777,7 +1792,7 @@ compiler."
linklib=$newlib
fi # test -n $old_archive_from_expsyms_cmds
- if test $linkmode = prog || test "$mode" != relink; then
+ if test "$linkmode" = prog || test "$mode" != relink; then
add_shlibpath=
add_dir=
add=
@@ -1826,7 +1841,7 @@ compiler."
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
fi
- if test $linkmode = prog; then
+ if test "$linkmode" = prog; then
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
test -n "$add" && compile_deplibs="$add $compile_deplibs"
else
@@ -1843,7 +1858,7 @@ compiler."
fi
fi
- if test $linkmode = prog || test "$mode" = relink; then
+ if test "$linkmode" = prog || test "$mode" = relink; then
add_shlibpath=
add_dir=
add=
@@ -1865,7 +1880,7 @@ compiler."
add="-l$name"
fi
- if test $linkmode = prog; then
+ if test "$linkmode" = prog; then
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else
@@ -1873,7 +1888,7 @@ compiler."
test -n "$add" && deplibs="$add $deplibs"
fi
fi
- elif test $linkmode = prog; then
+ elif test "$linkmode" = prog; then
if test "$alldeplibs" = yes &&
{ test "$deplibs_check_method" = pass_all ||
{ test "$build_libtool_libs" = yes &&
@@ -1932,9 +1947,9 @@ compiler."
fi
fi # link shared/static library?
- if test $linkmode = lib; then
+ if test "$linkmode" = lib; then
if test -n "$dependency_libs" &&
- { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
+ { test "$hardcode_into_libs" != yes || test $build_old_libs = yes ||
test $link_static = yes; }; then
# Extract -R from dependency_libs
temp_deplibs=
@@ -1964,7 +1979,7 @@ compiler."
tmp_libs="$tmp_libs $deplib"
done
- if test $link_all_deplibs != no; then
+ if test "$link_all_deplibs" != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
case $deplib in
@@ -2007,15 +2022,15 @@ compiler."
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
- if test $pass = dlpreopen; then
+ if test "$pass" = dlpreopen; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
deplibs="$deplib $deplibs"
done
fi
- if test $pass != dlopen; then
- test $pass != scan && dependency_libs="$newdependency_libs"
- if test $pass != conv; then
+ if test "$pass" != dlopen; then
+ test "$pass" != scan && dependency_libs="$newdependency_libs"
+ if test "$pass" != conv; then
# Make sure lib_search_path contains only unique directories.
lib_search_path=
for dir in $newlib_search_path; do
@@ -2073,7 +2088,7 @@ compiler."
deplibs=
fi
done # for pass
- if test $linkmode = prog; then
+ if test "$linkmode" = prog; then
dlfiles="$newdlfiles"
dlprefiles="$newdlprefiles"
fi
@@ -2410,7 +2425,7 @@ compiler."
;;
*)
# Add libc to deplibs on all other systems if necessary.
- if test $build_libtool_need_lc = "yes"; then
+ if test "$build_libtool_need_lc" = "yes"; then
deplibs="$deplibs -lc"
fi
;;
@@ -2683,7 +2698,7 @@ EOF
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
- if test $hardcode_into_libs = yes; then
+ if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
@@ -3354,6 +3369,9 @@ static const void *lt_preloaded_setup()
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
;;
+ *-*-openbsd*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
*)
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
exit 1
@@ -4412,40 +4430,6 @@ relink_command=\"$relink_command\""
# Exit here if they wanted silent mode.
test "$show" = ":" && exit 0
- echo "----------------------------------------------------------------------"
- echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- echo " $libdir"
- done
- echo
- echo "If you ever happen to want to link against installed libraries"
- echo "in a given directory, LIBDIR, you must either use libtool, and"
- echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
- echo "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
- echo " during execution"
- fi
- if test -n "$runpath_var"; then
- echo " - add LIBDIR to the \`$runpath_var' environment variable"
- echo " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- echo " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- echo " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- echo
- echo "See any operating system documentation about shared libraries for"
- echo "more information, such as the ld(1) and ld.so(8) manual pages."
- echo "----------------------------------------------------------------------"
exit 0
;;