SHARED_LIBS and USE_LIBTOOL

ok naddy@
This commit is contained in:
steven 2005-12-27 16:06:52 +00:00
parent e58f3f8cd1
commit 0f139f6b49
5 changed files with 19 additions and 172 deletions

View File

@ -1,9 +1,11 @@
# $OpenBSD: Makefile,v 1.28 2005/10/30 00:10:41 fgsch Exp $
# $OpenBSD: Makefile,v 1.29 2005/12/27 16:06:52 steven Exp $
COMMENT= "IJG's JPEG compression utilities"
DISTNAME= jpegsrc.v6b
PKGNAME= jpeg-6bp2
PKGNAME= jpeg-6bp3
SHARED_LIBS= jpeg 62.0
MODGNU_SHARED_LIBS= jpeg ''
CATEGORIES= graphics
MASTER_SITES= ftp://ftp.uu.net/graphics/jpeg/ \
ftp://ftp.shellhung.org/pub/Mirror/enlightenment/enlightenment/libs/
@ -14,6 +16,7 @@ PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c
USE_LIBTOOL= Yes
CONFIGURE_STYLE= gnu dest
CONFIGURE_ARGS+= ${CONFIGURE_SHARED}
CONFIGURE_ARGS+= --enable-static

View File

@ -1,78 +0,0 @@
$OpenBSD: patch-ltconfig,v 1.4 2002/01/24 04:24:09 brad Exp $
--- ltconfig.orig Wed Mar 25 10:25:39 1998
+++ ltconfig Wed Jan 23 20:19:34 2002
@@ -348,7 +348,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
# Check to see if we are using GCC.
@@ -706,6 +713,10 @@ amigaos* | sunos4*)
# On these operating systems, we should treat GNU ld like the system ld.
gnu_ld_acts_native=yes
;;
+openbsd*)
+ gnu_ld_acts_native=yes
+ with_gnu_ld=no
+ ;;
*)
gnu_ld_acts_native=no
;;
@@ -815,10 +826,24 @@ else
;;
openbsd*)
- archive_cmds='$LD -Bshareable -o $lib$libobjs'
- hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib$libobjs'
+ hardcode_libdir_flag_spec='${wl}-R$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib$libobjs'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib$libobjs'
+ hardcode_libdir_flag_spec='${wl}-R$libdir'
+ ;;
+ esac
+ fi
;;
os2*)
@@ -1179,11 +1204,19 @@ linux-gnu*)
fi
;;
-netbsd* | openbsd*)
+netbsd*)
+ version_type=sunos
+ library_names_spec='${libname}${release}.so.$versuffix'
+ finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+openbsd*)
version_type=sunos
library_names_spec='${libname}${release}.so.$versuffix'
finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
+ deplibs_check_method='pass_all'
;;
os2*)

View File

@ -1,90 +0,0 @@
$OpenBSD: patch-ltmain_sh,v 1.1 2001/02/20 22:21:09 danh Exp $
--- ltmain.sh.orig Wed Mar 25 10:25:39 1998
+++ ltmain.sh Tue Feb 20 17:20:20 2001
@@ -506,8 +506,29 @@ if test -z "$show_help"; then
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"
+ ;;
+
-no-undefined)
allow_undefined=no
continue
@@ -1002,7 +1023,15 @@ if test -z "$show_help"; then
# Add libc to deplibs on all systems.
dependency_libs="$deplibs"
- deplibs="$deplibs -lc"
+ case "$host_os" in
+ openbsd*)
+ # do not include libc due to us having libc/libc_r.
+ ;;
+ *)
+ # Add libc to deplibs on all other systems.
+ deplibs="$deplibs -lc"
+ ;;
+ esac
if test "$build_libtool_libs" = yes; then
# Get the real and link names of the library.
@@ -2023,37 +2052,6 @@ libdir='$install_libdir'\
done
fi
- echo "------------------------------------------------------------------------------"
- echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- echo " $libdir"
- done
- echo
- echo "To link against installed libraries in a given directory, LIBDIR,"
- echo "you must use the \`-LLIBDIR' flag during linking."
- echo
- echo " You will also need to do 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 -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
;;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-makefile_cfg,v 1.1 2005/12/27 16:06:52 steven Exp $
--- makefile.cfg.orig Mon Dec 26 23:43:20 2005
+++ makefile.cfg Mon Dec 26 23:43:43 2005
@@ -169,7 +169,7 @@ libjpeg.a: @A2K_DEPS@ $(LIBOBJECTS)
# with libtool:
libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS)
$(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \
- -rpath $(libdir) -version-info $(JPEG_LIB_VERSION)
+ -rpath $(libdir) $(libjpeg_la_LDFLAGS)
# sample programs:

View File

@ -1,2 +1,2 @@
@comment $OpenBSD: PFRAG.shared,v 1.3 2004/08/07 08:03:06 espie Exp $
@lib lib/libjpeg.so.62.0
@comment $OpenBSD: PFRAG.shared,v 1.4 2005/12/27 16:06:52 steven Exp $
@lib lib/libjpeg.so.${LIBjpeg_VERSION}