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 |
7 | lib1=iceconvert.so |
8 | lib2=iceconvert.dylib |
9 | # |
10 | ### Some MAC specific settings |
11 | export MACOSX_DEPLOYMENT_TARGET=10.3 |
12 | unset 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 *** |
17 | gcccomp="-c -g0 -Wall -Wno-long-long -I$ROOTSYS/include -I$ALIROOT/RALICE -I$ALIROOT/RALICE/icepack" |
18 | gccroot="-c -g0 -ansi -pedantic -Wall -Wno-long-long -I$ROOTSYS/include -I$ALIROOT/RALICE -I$ALIROOT/RALICE/icepack" |
19 | # |
20 | echo "lib = " $lib |
21 | echo "gcccomp = " $gcccomp |
22 | echo "gccroot = " $gccroot |
23 | # |
24 | ### Go to the directory with the source files |
25 | cd $ALIROOT/RALICE/icepack/iceconvert |
26 | # |
27 | ### Create the dictionary files |
28 | rootcint -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 |
33 | gcc $gcccomp *.c |
34 | g++ $gccroot *.cxx |
35 | # |
a0f305cd |
36 | # Creating iceconvert.so library |
f60271ca |
37 | g++ -v -bundle -undefined dynamic_lookup -o $lib1 *.o |
38 | # |
a0f305cd |
39 | # Creating iceconvert.dylib library |
f60271ca |
40 | g++ -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 | # |
44 | rm zzziceconvertdict.* |
45 | rm *.o |
46 | # |
47 | ### Move the created lib to the scripts directory and go there |
48 | mv $lib1 scripts |
49 | mv $lib2 scripts |
50 | cd scripts |
51 | # |
52 | echo ' ' |
53 | echo '*** macgcclib.sh done. Results in iceconvert.so and iceconvert.dylib' |