#!/bin/sh
#/*----------------------------------------------------------------------------*/
#/*                                                                            */
#/* Copyright (c) 2007-2018 Rexx Language Association. All rights reserved.    */
#/*                                                                            */
#/* This program and the accompanying materials are made available under       */
#/* the terms of the Common Public License v1.0 which accompanies this         */
#/* distribution. A copy is also available at the following address:           */
#/* http://www.oorexx.org/license.html                                         */
#/*                                                                            */
#/* Redistribution and use in source and binary forms, with or                 */
#/* without modification, are permitted provided that the following            */
#/* conditions are met:                                                        */
#/*                                                                            */
#/* Redistributions of source code must retain the above copyright             */
#/* notice, this list of conditions and the following disclaimer.              */
#/* Redistributions in binary form must reproduce the above copyright          */
#/* notice, this list of conditions and the following disclaimer in            */
#/* the documentation and/or other materials provided with the distribution.   */
#/*                                                                            */
#/* Neither the name of Rexx Language Association nor the names                */
#/* of its contributors may be used to endorse or promote products             */
#/* derived from this software without specific prior written permission.      */
#/*                                                                            */
#/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS        */
#/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT          */
#/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS          */
#/* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT   */
#/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,      */
#/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED   */
#/* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,        */
#/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY     */
#/* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING    */
#/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS         */
#/* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.               */
#/*                                                                            */
#/*----------------------------------------------------------------------------*/

orx_current=@ORX_SUBST_CURRENT@
orx_revision=@ORX_SUBST_REVISION@
orx_age=@ORX_SUBST_AGE@

# Set up the library version suffix.
orx_libversion=${orx_current}.${orx_age}.${orx_revision}

orx_prefix=@prefix@

# Debian doesn't use lib64, so this is the same for 32-bit or 64-bit
lib_dir=${orx_prefix}/lib
bin_dir=${orx_prefix}/bin
data_dir=${orx_prefix}/share/ooRexx

#  On debian, we may not need to add links for the private libraries the
#  interpreter uses, they should be found automatically.  However, on some Linux
#  distributions we do need all the links.  So, just add all of them.
ln -sf ${lib_dir}/librexx.so ${lib_dir}/librexx.so.@ORX_SUBST_CURRENT@
ln -sf ${lib_dir}/librexx.so ${lib_dir}/librexx.so.${orx_libversion}
ln -sf ${lib_dir}/librexxapi.so ${lib_dir}/librexxapi.so.@ORX_SUBST_CURRENT@
ln -sf ${lib_dir}/librexxapi.so ${lib_dir}/librexxapi.so.${orx_libversion}
ln -sf ${lib_dir}/librxsock.so ${lib_dir}/librxsock.so.@ORX_SUBST_CURRENT@
ln -sf ${lib_dir}/librxsock.so ${lib_dir}/librxsock.so.${orx_libversion}
ln -sf ${lib_dir}/librxmath.so ${lib_dir}/librxmath.so.@ORX_SUBST_CURRENT@
ln -sf ${lib_dir}/librxmath.so ${lib_dir}/librxmath.so.${orx_libversion}
ln -sf ${lib_dir}/librxregexp.so ${lib_dir}/librxregexp.so.@ORX_SUBST_CURRENT@
ln -sf ${lib_dir}/librxregexp.so ${lib_dir}/librxregexp.so.${orx_libversion}
ln -sf ${lib_dir}/librexxutil.so ${lib_dir}/librexxutil.so.@ORX_SUBST_CURRENT@
ln -sf ${lib_dir}/librexxutil.so ${lib_dir}/librexxutil.so.${orx_libversion}
ln -sf ${lib_dir}/libhostemu.so ${lib_dir}/libhostemu.so.@ORX_SUBST_CURRENT@
ln -sf ${lib_dir}/libhostemu.so ${lib_dir}/libhostemu.so.${orx_libversion}
ln -sf ${lib_dir}/librxunixsys.so ${lib_dir}/librxunixsys.so.@ORX_SUBST_CURRENT@
ln -sf ${lib_dir}/librxunixsys.so ${lib_dir}/librxunixsys.so.${orx_libversion}

# allow backwards compatibility to previous versions
ln -sf ${lib_dir}/librexx.so ${lib_dir}/librexx.so.2
ln -sf ${lib_dir}/librexx.so ${lib_dir}/librexx.so.3
ln -sf ${lib_dir}/librexxapi.so ${lib_dir}/librexxapi.so.2
ln -sf ${lib_dir}/librexxapi.so ${lib_dir}/librexxapi.so.3
ln -sf ${lib_dir}/librxsock.so ${lib_dir}/librxsock.so.2
ln -sf ${lib_dir}/librxsock.so ${lib_dir}/librxsock.so.3
ln -sf ${lib_dir}/librxmath.so ${lib_dir}/libxmath.so.2
ln -sf ${lib_dir}/librxmath.so ${lib_dir}/libxmath.so.3
ln -sf ${lib_dir}/librxregexp.so ${lib_dir}/librxregexp.so.2
ln -sf ${lib_dir}/librxregexp.so ${lib_dir}/librxregexp.so.3
ln -sf ${lib_dir}/librexxutil.so ${lib_dir}/librexxutil.so.2
ln -sf ${lib_dir}/librexxutil.so ${lib_dir}/librexxutil.so.3

# Although rexxtry is technically a sample, historically we have set it up to
# be used like the other executables.
ln -sf ${data_dir}/rexxtry.rex ${bin_dir}/rexxtry.rex





