Skip to content
Snippets Groups Projects
Commit 48a407b8 authored by Steven Murray's avatar Steven Murray
Browse files

First draft of compilation rules for mounttape. These rules are actually...

First draft of compilation rules for mounttape.  These rules are actually disactivated because they have been commented out. I am nonetheless pushing this commit into the central repository because I'm I won't be coding again until next week.
parent 8279ef5e
Branches
Tags
No related merge requests found
......@@ -69,17 +69,17 @@ set (CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
set_property ( DIRECTORY PROPERTY COMPILE_DEFINITIONS _LARGEFILE64_SOURCE)
# Generate the compilation variables, if needed
if(NOT DEFINED COMPILING_NOSTK)
set(COMPILING_NOSTK 0)
message(STATUS "Setting option COMPILING_NOSTK to default (0). Override with
option -DCOMPILING_NOSTK:STRING=1")
endif(NOT DEFINED COMPILING_NOSTK)
if(NOT DEFINED COMPILE_STK)
message(STATUS "Setting COMPILE_STK to the default value of 0")
message(STATUS "Override with -DCOMPILE_STK:STRING=1")
set(COMPILE_STK 0)
endif(NOT DEFINED COMPILE_STK)
if(NOT DEFINED COMPILING_CLIENT)
set(COMPILING_CLIENT 0)
message(STATUS "Setting option COMPILING_CLIENT to default (0). Override
with option -DCOMPILING_CLIENT:STRING=1")
endif(NOT DEFINED COMPILING_CLIENT)
if(NOT DEFINED COMPILE_CLIENT)
message(STATUS "Setting COMPILING_CLIENT to the value of 0")
message(STATUS "Override with -DCOMPILING_CLIENT:STRING=1")
set(COMPILE_CLIENT 0)
endif(NOT DEFINED COMPILE_CLIENT)
################################################################################
# Include the subdirectories of the project
......
......@@ -6,8 +6,8 @@
# Partial compilations
#---------------------
%define compiling_nostk @COMPILING_NOSTK@
%define compiling_client @COMPILING_CLIENT@
%define compile_stk @COMPILE_STK@
%define compile_client @COMPILE_CLIENT@
# General settings
#-----------------
......@@ -21,10 +21,10 @@ License: http://cern.ch/castor/DIST/CONDITIONS
Group: Application/Castor
BuildRoot: %{_builddir}/%{name}-%{version}-root
# only build debug info if you're building the whole code
%if %compiling_client
%if %compile_client
%define debug_package %{nil}
%endif
%if %compiling_client
%if %compile_client
%else
BuildRequires: oracle-instantclient-devel
%endif
......@@ -36,16 +36,17 @@ The CASTOR Project stands for CERN Advanced STORage Manager, and its goal is to
%setup -q -n %{name}-%{version}-%{release}
%build
# rpmbuild --define="compilenostk 1" ...
%if 0%{?compilenostk:1} > 0
%define compiling_nostk 1
export CASTOR_NOSTK=%compiling_nostk
%if %compile_stk
unset CASTOR_NOSTK
%else
export CASTOR_NOSTK=1
%endif
# rpmbuild --define "clientonly 1" ...
%if 0%{?clientonly:1} > 0
%define compiling_client 1
export CASTOR_CLIENT=%compiling_client
%define compile_client 1
export CASTOR_CLIENT=%compile_client
# Suppress oracompile.py warnings in clientonly mode
export ORACOMPILE_OPTIONS="--quiet"
%endif
......@@ -58,7 +59,7 @@ export MINOR_CASTOR_VERSION
mkdir -p build
cd build
MAJOR_CASTOR_VERSION=${MAJOR_CASTOR_VERSION} MINOR_CASTOR_VERSION=${MINOR_CASTOR_VERSION} cmake ..
%if %compiling_client
%if %compile_client
(cd h; ln -s . shift)
echo "Only compiling client part"
%{__make} -s %{_smp_mflags} client
......@@ -75,12 +76,14 @@ export MINOR_CASTOR_VERSION
%{__rm} -rf ${RPM_BUILD_ROOT}
# rpmbuild --define="compilenostk 1" ...
%if 0%{?compilenostk:1} > 0
%if %compile_stk
unset CASTOR_NOSTK
%else
export CASTOR_NOSTK=1
%endif
cd build
%if %compiling_client
%if %compile_client
%{__make} installclient DESTDIR=${RPM_BUILD_ROOT} EXPORTMAN=${RPM_BUILD_ROOT}/usr/share/man
%else
%{__make} install DESTDIR=${RPM_BUILD_ROOT} EXPORTMAN=${RPM_BUILD_ROOT}/usr/share/man
......
......@@ -92,3 +92,46 @@ add_executable(rlstape-nostk ${RLSTAPE_NOSTK_SRC_FILES})
target_link_libraries(rlstape-nostk castorcommon castorrmc castortape
castorvdqm)
install (TARGETS rlstape-nostk DESTINATION ${CASTOR_DEST_BIN_DIR})
foreach(SRC_FILE mounttape rbtsubr)
set (TAPE_STK_SRC_FILES ${TAPE_STK_SRC_FILES} ${SRC_FILE}-stk.c)
add_custom_command (
OUTPUT ${SRC_FILE}-stk.c DEPENDS ${SRC_FILE}.c
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${SRC_FILE}.c ${CMAKE_CURRENT_BINARY_DIR}/${SRC_FILE}-stk.c)
set_property(SOURCE ${SRC_FILE}-stk.c
PROPERTY COMPILE_FLAGS "-DCDK -DLINUX -I/usr/include/CDK")
endforeach ()
foreach(SRC_FILE ${TAPE_STK_SRC_FILES})
message (STATUS "STEVE WAS ERE AGAIN - ${SRC_FILE}")
endforeach ()
find_library (STK_CDK_API_LIB api PATHS /usr/lib64/CDK NO_DEFAULT_PATH)
if (STK_CDK_API_LIB)
message(STATUS "Found the STK CDK api library: ${STK_CDK_API_LIB}")
endif (STK_CDK_API_LIB)
find_library (STK_CDK_UTL_LIB utl PATHS /usr/lib64/CDK NO_DEFAULT_PATH)
if (STK_CDK_UTL_LIB)
message(STATUS "Found the STK CDK utl library: ${STK_CDK_UTL_LIB}")
endif (STK_CDK_UTL_LIB)
find_library (STK_CDK_IPC_LIB ipc PATHS /usr/lib64/CDK NO_DEFAULT_PATH)
if (STK_CDK_IPC_LIB)
message(STATUS "Found the STK CDK ipc library: ${STK_CDK_IPC_LIB}")
endif (STK_CDK_IPC_LIB)
find_library (STK_CDK_CL_LIB cl PATHS /usr/lib64/CDK NO_DEFAULT_PATH)
if (STK_CDK_CL_LIB)
message(STATUS "Found the STK CDK cl library: ${STK_CDK_CL_LIB}")
endif (STK_CDK_CL_LIB)
set (MOUNTTAPE_SRC_FILES mounttape-stk.c asc2ebc.c buildhdrlbl.c
buildvollbl.c ebc2asc.c getdrvstatus.c inquiry.c rbtsubr-stk.c readlbl.c
rwndtape.c send2tpd.c sendrep.c setCompression.c skiptape.c tperror.c
tplogit.c unldtape.c usrmsg.c writelbl.c wrttpmrk.c mircheck.c)
#add_executable(mounttape ${MOUNTTAPE_SRC_FILES})
#target_link_libraries(mounttape castorcommon castorrmc castortape castorvdqm)
#install (TARGETS mounttape DESTINATION ${CASTOR_DEST_BIN_DIR})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment