1998-04-06 03:01:59 +00:00
#!/bin/csh
#
# ld_lib_path.csh
#
2001-07-06 09:37:11 +00:00
# Set up the LD_LIBRARY_PATH (or similar env variable for your system)
1998-04-06 03:01:59 +00:00
#
2007-02-14 13:46:52 +00:00
# Copyright (C) 1998-2007 Free Software Foundation, Inc.
1998-04-06 03:01:59 +00:00
#
# Author: Scott Christley <scottc@net-community.com>
# Author: Ovidiu Predescu <ovidiu@net-community.com>
2007-02-14 13:46:52 +00:00
# Author: Nicola Pero <nicola.pero@meta-innovation.com>
1998-04-06 03:01:59 +00:00
#
# This file is part of the GNUstep Makefile Package.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
2007-11-07 18:56:37 +00:00
# as published by the Free Software Foundation; either version 3
1998-04-06 03:01:59 +00:00
# of the License, or (at your option) any later version.
#
# You should have received a copy of the GNU General Public
2007-11-07 18:56:37 +00:00
# License along with this library; see the file COPYING.
1998-04-06 03:01:59 +00:00
# If not, write to the Free Software Foundation,
2005-05-22 03:20:14 +00:00
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1998-04-06 03:01:59 +00:00
#
2007-02-14 13:46:52 +00:00
if ( "$GNUSTEP_IS_FLATTENED" == "yes" ) then
set lib_paths = ` $GNUSTEP_MAKEFILES /print_unique_pathlist.sh "$GNUSTEP_USER_LIBRARIES" "$GNUSTEP_LOCAL_LIBRARIES" "$GNUSTEP_NETWORK_LIBRARIES" "$GNUSTEP_SYSTEM_LIBRARIES" $fixup_paths `
2000-12-05 16:11:55 +00:00
else
2007-02-14 13:46:52 +00:00
set lib_paths = ` $GNUSTEP_MAKEFILES /print_unique_pathlist.sh "$GNUSTEP_USER_LIBRARIES/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO" "$GNUSTEP_USER_LIBRARIES/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS" "$GNUSTEP_LOCAL_LIBRARIES/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO" "$GNUSTEP_LOCAL_LIBRARIES/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS" $fixup_paths `
1998-04-06 03:01:59 +00:00
2007-02-14 13:46:52 +00:00
set lib_paths = "$lib_paths" :` $GNUSTEP_MAKEFILES /print_unique_pathlist.sh "$GNUSTEP_NETWORK_LIBRARIES/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO" "$GNUSTEP_NETWORK_LIBRARIES/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS" "$GNUSTEP_SYSTEM_LIBRARIES/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS/$LIBRARY_COMBO" "$GNUSTEP_SYSTEM_LIBRARIES/$GNUSTEP_HOST_CPU/$GNUSTEP_HOST_OS" $fixup_paths ` :
1998-04-06 03:01:59 +00:00
endif
2007-02-14 13:46:52 +00:00
set fw_paths = ` $GNUSTEP_MAKEFILES /print_unique_pathlist.sh "$GNUSTEP_USER_LIBRARY/Frameworks" "$GNUSTEP_LOCAL_LIBRARY/Frameworks" "$GNUSTEP_NETWORK_LIBRARY/Frameworks" "$GNUSTEP_SYSTEM_LIBRARY/Frameworks" $fixup_paths `
2004-04-02 07:28:02 +00:00
2007-02-14 13:46:52 +00:00
switch ( "${GNUSTEP_HOST_OS}" )
1998-04-06 03:01:59 +00:00
case *nextstep4* :
1998-08-20 17:48:46 +00:00
if ( $? DYLD_LIBRARY_PATH = = 0 ) then
2003-04-25 15:16:36 +00:00
setenv DYLD_LIBRARY_PATH "${lib_paths}"
else if ( { ( echo "${DYLD_LIBRARY_PATH}" | fgrep -v "${lib_paths}" >/dev/null) } ) then
setenv DYLD_LIBRARY_PATH "${lib_paths}:${DYLD_LIBRARY_PATH}"
2002-12-31 04:16:16 +00:00
endif
breaksw
case *darwin* :
if ( $? DYLD_LIBRARY_PATH = = 0 ) then
2003-04-25 15:16:36 +00:00
setenv DYLD_LIBRARY_PATH "${lib_paths}"
else if ( { ( echo "${DYLD_LIBRARY_PATH}" | fgrep -v "${lib_paths}" >/dev/null) } ) then
setenv DYLD_LIBRARY_PATH "${lib_paths}:${DYLD_LIBRARY_PATH}"
1998-08-20 17:48:46 +00:00
endif
2004-08-24 16:46:08 +00:00
# The code below has been temporarily removed, because...
2005-04-15 22:50:11 +00:00
# Frameworks in GNUstep-make are supported by creating a link like
#
# Libraries/libMyFramework.dylib ->
# Frameworks/MyFramework.framework/Versions/Current/libMyFramework.dylib,
2004-08-24 16:46:08 +00:00
#
2005-04-15 22:50:11 +00:00
# to mitigate the fact that FSF GCC does not support a -framework flag.
#
# On Darwin, however, we partially emulate -framework by setting the
# "install_name" to the framework name during linking. The dynamic
# linker (dyld) is smart enough to find the framework under this name,
# but only if DYLD_FRAMEWORK_PATH is set (unless we set the
# "install_name" to an absolute path, which we don't). We'd really like
# to fully support -framework, though.
#
# Use otool -L MyApplication.app/MyApplication, for instance, to see
# how the shared libraries/frameworks are linked.
#
# if [ "$LIBRARY_COMBO" = "apple-apple-apple" -o \
# "$LIBRARY_COMBO" = "apple" ]; then
2004-04-02 07:28:02 +00:00
2004-06-07 14:54:18 +00:00
if ( $? DYLD_FRAMEWORK_PATH = = 0 ) then
setenv DYLD_FRAMEWORK_PATH "${fw_paths}"
else if ( { ( echo "${DYLD_FRAMEWORK_PATH}" | fgrep -v "${fw_paths}" >/dev/null) } ) then
setenv DYLD_FRAMEWORK_PATH "${fw_paths}:${DYLD_FRAMEWORK_PATH}"
endif
1998-04-06 03:01:59 +00:00
breaksw
2000-04-06 15:01:12 +00:00
case *hpux* :
if ( $? SHLIB_PATH = = 0 ) then
2003-04-25 15:16:36 +00:00
setenv SHLIB_PATH "${lib_paths}"
else if ( { ( echo "${SHLIB_PATH}" | fgrep -v "${lib_paths}" >/dev/null) } ) then
setenv SHLIB_PATH "${lib_paths}:${SHLIB_PATH}"
2000-04-06 15:01:12 +00:00
endif
if ( $? LD_LIBRARY_PATH = = 0 ) then
2003-04-25 15:16:36 +00:00
setenv LD_LIBRARY_PATH "${lib_paths}"
else if ( { ( echo "${LD_LIBRARY_PATH}" | fgrep -v "${lib_paths}" >/dev/null) } ) then
setenv LD_LIBRARY_PATH "${lib_paths}:${LD_LIBRARY_PATH}"
2000-04-06 15:01:12 +00:00
endif
2001-07-26 18:34:42 +00:00
2000-04-06 15:01:12 +00:00
breaksw
1998-04-06 03:01:59 +00:00
case * :
1998-08-20 17:48:46 +00:00
if ( $? LD_LIBRARY_PATH = = 0 ) then
2003-04-25 15:16:36 +00:00
setenv LD_LIBRARY_PATH "${lib_paths}"
else if ( { ( echo "${LD_LIBRARY_PATH}" | fgrep -v "${lib_paths}" >/dev/null) } ) then
setenv LD_LIBRARY_PATH "${lib_paths}:${LD_LIBRARY_PATH}"
1998-08-20 17:48:46 +00:00
endif
1998-04-06 03:01:59 +00:00
breaksw
endsw
2006-10-03 17:23:36 +00:00
unset tool_path_part last_path_part host_os dir lib_paths fw_paths
2002-01-11 12:35:37 +00:00