Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper support for archive libraries. #815

Merged
merged 1 commit into from Jul 1, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions geant4-toolfile.spec
Expand Up @@ -48,6 +48,20 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/geant4core.xml
</tool>
EOF_TOOLFILE

cat << \EOF_TOOLFILE >%i/etc/scram.d/geant4static.xml
<tool name="geant4static" version="@TOOL_VERSION@">
<info url="http://geant4.web.cern.ch/geant4/"/>
<lib name="geant4-static"/>
<flags CXXFLAGS="-ftls-model=global-dynamic -pthread"/>
<client>
<environment name="GEANT4STATIC_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$GEANT4STATIC_BASE/lib/archive"/>
</client>
<use name="clhep"/>
<use name="xerces-c"/>
</tool>
EOF_TOOLFILE

cat << \EOF_TOOLFILE >%i/etc/scram.d/geant4vis.xml
<tool name="geant4vis" version="@TOOL_VERSION@">
<info url="http://geant4.web.cern.ch/geant4/"/>
Expand Down
11 changes: 10 additions & 1 deletion geant4.spec
Expand Up @@ -36,6 +36,7 @@ cd ../build

cmake ../%{n}.%{realversion} \
-DCMAKE_CXX_COMPILER="%cms_cxx" \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_INSTALL_PREFIX:PATH="%i" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -51,13 +52,21 @@ cmake ../%{n}.%{realversion} \
-DGEANT4_INSTALL_EXAMPLES=OFF \
-DGEANT4_USE_SYSTEM_CLHEP=ON \
-DGEANT4_BUILD_MULTITHREADED=OFF \
-DCMAKE_STATIC_LIBRARY_CXX_FLAGS="-fPIC" \
-DCMAKE_STATIC_LIBRARY_C_FLAGS="-fPIC"

make %makeprocesses VERBOSE=1
make %makeprocesses

%install

cd ../build
make install

mkdir -p %i/lib/archive
cd %i/lib/archive
find %i/lib -name "*.a" -exec ar x {} \;
ar rcs libgeant4-static.a *.o
find . -name "*.o" -delete

%post
%{relocateConfig}lib/Geant4-*/Geant4Config.cmake