21-jun-2005 NvE Install scripts for gcc corrected to also include the rdmc stuff
[u/mrichter/AliRoot.git] / RALICE / icepack / iceconvert / scripts / macgcclib.sh
CommitLineData
f60271ca 1#!/bin/sh
2### Shell script to create a ROOT loadable GCC shared lib out of .cxx source code
3###
4### NvE 23-may-2000 UU-SAP Utrecht
5#
6### Name of the produced shared libraries
7lib1=iceconvert.so
8lib2=iceconvert.dylib
9#
10### Some MAC specific settings
11export MACOSX_DEPLOYMENT_TARGET=10.3
12unset LD_PREBIND
13#
14### The option string for GCC shared lib compilation and linking ***
15### For the GCC ROOT loadable shared lib the strict requirements are ***
16### dropped to avoid many warnings from the rootcint generated code ***
17gcccomp="-c -g0 -Wall -Wno-long-long -I$ROOTSYS/include -I$ALIROOT/RALICE -I$ALIROOT/RALICE/icepack"
18gccroot="-c -g0 -ansi -pedantic -Wall -Wno-long-long -I$ROOTSYS/include -I$ALIROOT/RALICE -I$ALIROOT/RALICE/icepack"
19#
20echo "lib = " $lib
21echo "gcccomp = " $gcccomp
22echo "gccroot = " $gccroot
23#
24### Go to the directory with the source files
25cd $ALIROOT/RALICE/icepack/iceconvert
26#
27### Create the dictionary files
28rootcint -f zzziceconvertdict.cxx -c -p -I$ALIROOT/RALICE -I$ALIROOT/RALICE/icepack ICEConvHeaders.h ICEConvLinkDef.h
29#
30### Compile and create the ROOT loadable shared library
31#
32# Compilation phase
33gcc $gcccomp *.c
34g++ $gccroot *.cxx
35#
a0f305cd 36# Creating iceconvert.so library
f60271ca 37g++ -v -bundle -undefined dynamic_lookup -o $lib1 *.o
38#
a0f305cd 39# Creating iceconvert.dylib library
f60271ca 40g++ -v -dynamiclib -undefined dynamic_lookup -single_module -o $lib2 *.o
41### On some systems the following extra "-read_only_relocs" flag might be needed
42# g++ -v -dynamiclib -undefined dynamic_lookup -single_module -read_only_relocs -o $lib2 *.o
43#
44rm zzziceconvertdict.*
45rm *.o
46#
47### Move the created lib to the scripts directory and go there
48mv $lib1 scripts
49mv $lib2 scripts
50cd scripts
51#
52echo ' '
53echo '*** macgcclib.sh done. Results in iceconvert.so and iceconvert.dylib'