SHARED_LIBS and USE_LIBTOOL

This commit is contained in:
steven 2005-12-26 15:14:11 +00:00
parent 16ecab1430
commit 7e92e854a8
4 changed files with 7 additions and 135 deletions

View File

@ -1,8 +1,11 @@
# $OpenBSD: Makefile,v 1.22 2005/10/30 00:10:40 fgsch Exp $
# $OpenBSD: Makefile,v 1.23 2005/12/26 15:14:11 steven Exp $
COMMENT= "ascii art library"
DISTNAME= aalib-1.2
PKGNAME= ${DISTNAME}p0
SHARED_LIBS= aa 1.3
MODGNU_SHARED_LIBS= aa ''
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_OPENBSD}
@ -15,6 +18,7 @@ PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c m ncurses
USE_LIBTOOL= Yes
CONFIGURE_STYLE= gnu dest
CONFIGURE_ARGS+= ${CONFIGURE_SHARED}
CONFIGURE_ARGS+= --enable-static

View File

@ -1,88 +0,0 @@
$OpenBSD: patch-ltconfig,v 1.3 2001/02/20 21:38:54 danh Exp $
--- ltconfig.orig Thu Sep 25 08:22:04 1997
+++ ltconfig Tue Feb 20 16:28:56 2001
@@ -451,12 +451,13 @@ else
esac
fi
-case "$host_cpu" in
-rs6000 | powerpc | powerpcle)
- # Yippee! All RS/6000 and PowerPC code is position-independent.
- pic_flag=
- ;;
-esac
+# Bogus
+#case "$host_cpu" in
+#rs6000 | powerpc | powerpcle)
+# # Yippee! All RS/6000 and PowerPC code is position-independent.
+# pic_flag=
+# ;;
+#esac
if test -n "$pic_flag"; then
echo $ac_t "$pic_flag" 1>&6
@@ -575,6 +576,12 @@ hardcode_runpath_var=no
hardcode_shlibpath_var=unsupported
runpath_var=
+case "$host_os" in
+openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# See if GNU ld supports shared libraries.
@@ -666,7 +673,7 @@ else
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
;;
- netbsd* | openbsd*)
+ netbsd*)
# Tested with NetBSD 1.2 ld
archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs'
hardcode_libdir_flag_spec='-R$libdir'
@@ -674,6 +681,24 @@ else
hardcode_shlibpath_var=no
;;
+ openbsd*)
+ 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 $linkopts'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linkopts'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ if [ "`/usr/bin/file /usr/lib/libc.so.* | grep ELF`" != "" ]; then
+ export_dynamic_flag_spec='${wl}-E'
+ fi
+ ;;
+ esac
+ ;;
+
osf3* | osf4*)
allow_undefined_flag=' -expect_unresolved'
archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs'
@@ -827,6 +852,7 @@ netbsd* | openbsd*)
library_names_spec='$libname.so.$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
+ deplibs_check_method='pass_all'
;;
osf3* | osf4*)
@@ -946,6 +972,9 @@ host="$host"
# The archiver.
AR='$AR'
+
+# The default C compiler.
+CC=$CC
# The linker used to build libraries.
LD='$LD'

View File

@ -1,44 +0,0 @@
--- ltmain.sh.orig Thu Sep 25 08:22:11 1997
+++ ltmain.sh Tue Feb 20 20:16:56 2001
@@ -365,7 +365,28 @@
deplibs="$deplibs $arg"
;;
- -l*) deplibs="$deplibs $arg" ;;
+ -l*)
+ if test "$arg" = "-lc"; then
+ case "$host" in
+ *-*-openbsd*)
+ # Do not include libc due to us having libc/libc_r.
+ 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"
+ ;;
+
+ -?thread)
+ deplibs="$deplibs $arg"
+ ;;
-o) prev=output ;;
@@ -1575,11 +1596,6 @@
done
fi
- echo "To link against installed libraries in LIBDIR, users may have to:"
- if test -n "$shlibpath_var"; then
- echo " - add LIBDIR to their \`$shlibpath_var' environment variable"
- fi
- echo " - use the \`-LLIBDIR' linker flag"
exit 0
;;

View File

@ -1,2 +1,2 @@
@comment $OpenBSD: PFRAG.shared,v 1.3 2004/09/15 00:50:08 espie Exp $
@lib lib/libaa.so.1.3
@comment $OpenBSD: PFRAG.shared,v 1.4 2005/12/26 15:14:12 steven Exp $
@lib lib/libaa.so.${LIBaa_VERSION}