Skip to content

Commit

Permalink
Add support for ARM and add missing include dir for libuuid.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Abdurachmanov committed Feb 26, 2013
1 parent 251b65a commit 20f6afe
Show file tree
Hide file tree
Showing 3 changed files with 233 additions and 2 deletions.
45 changes: 45 additions & 0 deletions castor-2.1.13.9-fix-arm-m32-option.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/gridftp2/external/Imakefile b/gridftp2/external/Imakefile
index 049e172..dfccf07 100644
--- a/gridftp2/external/Imakefile
+++ b/gridftp2/external/Imakefile
@@ -24,7 +24,9 @@ COMM
COMM @author castor-dev@cern.ch
COMM

-MOPTION=-m32
+ifeq ($(shell uname -m), i386)
+ MOPTION=-m32
+endif
ifeq ($(shell uname -m), x86_64)
MOPTION=-m64
endif
diff --git a/gridftp2/internal/Imakefile b/gridftp2/internal/Imakefile
index 4e1378e..30dbdfd 100644
--- a/gridftp2/internal/Imakefile
+++ b/gridftp2/internal/Imakefile
@@ -24,7 +24,9 @@ COMM
COMM @author castor-dev@cern.ch
COMM

-MOPTION=-m32
+ifeq ($(shell uname -m), i386)
+ MOPTION=-m32
+endif
ifeq ($(shell uname -m), x86_64)
MOPTION=-m64
endif
diff --git a/gridftp2/xroot/Imakefile b/gridftp2/xroot/Imakefile
index d915dcb..29a523d 100644
--- a/gridftp2/xroot/Imakefile
+++ b/gridftp2/xroot/Imakefile
@@ -24,7 +24,9 @@ COMM
COMM @author castor-dev@cern.ch
COMM

-MOPTION=-m32
+ifeq ($(shell uname -m), i386)
+ MOPTION=-m32
+endif
ifeq ($(shell uname -m), x86_64)
MOPTION=-m64
endif
182 changes: 182 additions & 0 deletions castor-2.1.13.9-fix-arm-type-limits.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
diff --git a/castor/server/BaseDaemon.cpp b/castor/server/BaseDaemon.cpp
index 4a213e6..cdf1c60 100644
--- a/castor/server/BaseDaemon.cpp
+++ b/castor/server/BaseDaemon.cpp
@@ -166,9 +166,9 @@ void castor::server::BaseDaemon::parseCommandLine(int argc, char *argv[])
Copterr = 0;
Coptreset = 1;

- char c;
+ int c;
while ((c = Cgetopt_long(argc, argv, (char*)m_cmdLineParams.str().c_str(), longopts, NULL)) != -1) {
- switch (c) {
+ switch ((char)c) {
case 'f':
m_foreground = true;
break;
diff --git a/client/src/stager/stager_client_commandline.cpp b/client/src/stager/stager_client_commandline.cpp
index 0139846..f8919f0 100644
--- a/client/src/stager/stager_client_commandline.cpp
+++ b/client/src/stager/stager_client_commandline.cpp
@@ -184,8 +184,7 @@ extern "C" {
int parseCmdLine(int argc, char *argv[], int (*callback)(const char *),
char** service_class, char** usertag, int* display_reqid)
{
- int Coptind, Copterr, errflg;
- char c;
+ int Coptind, Copterr, errflg, c;
static struct Coptions longopts[] =
{
{"filename", REQUIRED_ARGUMENT, NULL, 'M'},
@@ -202,7 +201,7 @@ int parseCmdLine(int argc, char *argv[], int (*callback)(const char *),
errflg = 0;

while ((c = Cgetopt_long (argc, argv, "f:M:S:U:rh", longopts, NULL)) != -1) {
- switch (c) {
+ switch ((char)c) {
case 'M':
if (0 != callback) {
callback(Coptarg);
diff --git a/client/src/stager/stager_qry.cpp b/client/src/stager/stager_qry.cpp
index e330017..90068a8 100644
--- a/client/src/stager/stager_qry.cpp
+++ b/client/src/stager/stager_qry.cpp
@@ -324,8 +324,7 @@ void handleDiskPoolQuery(int argc, char *argv[]) {
// -----------------------------------------------------------------------
int parseCmdLineFileQuery(int argc, char *argv[],
struct cmd_args *args) {
- int nbargs, errflg, getNextMode, i;
- char c;
+ int nbargs, errflg, getNextMode, i, c;

Coptind = 1;
Copterr = 1;
@@ -335,7 +334,7 @@ int parseCmdLineFileQuery(int argc, char *argv[],
while ((c = Cgetopt_long (argc, argv,
"M:f:E:F:U:r:nS:",
longopts_fileQuery, NULL)) != -1) {
- switch (c) {
+ switch ((char)c) {
case 'M':
args->requests[nbargs].type = BY_FILENAME;
args->requests[nbargs].param = (char *)strdup(Coptarg);
@@ -419,8 +418,7 @@ int parseCmdLineFileQuery(int argc, char *argv[],
int parseCmdLineDiskPoolQuery(int argc, char *argv[],
char** diskPool, char** svcClass, int *siflag,
enum castor::query::DiskPoolQueryType* queryType) {
- int errflg;
- char c;
+ int errflg, c;

Coptind = 1;
Copterr = 1;
@@ -430,7 +428,7 @@ int parseCmdLineDiskPoolQuery(int argc, char *argv[],
while ((c = Cgetopt_long (argc, argv,
"sd:S:iHat",
longopts_diskPoolQuery, NULL)) != -1) {
- switch (c) {
+ switch ((char)c) {
case 'd':
*diskPool = (char *)strdup(Coptarg);
break;
@@ -465,8 +463,7 @@ int parseCmdLineDiskPoolQuery(int argc, char *argv[],
// -----------------------------------------------------------------------
int checkAndCountArguments(int argc, char *argv[],
int* count, enum queryType* type) {
- int errflg;
- char c;
+ int errflg, c;

Coptind = 1;
Copterr = 1;
@@ -475,7 +472,7 @@ int checkAndCountArguments(int argc, char *argv[],
*type = FILEQUERY;
while ((c = Cgetopt_long
(argc, argv, "M:f:F:U:r:nhsd:S:iHat", longopts, NULL)) != -1) {
- switch (c) {
+ switch ((char)c) {
case 'M':
case 'F':
case 'U':
diff --git a/client/src/stager/stager_rm.c b/client/src/stager/stager_rm.c
index 162ef3f..16d2831 100644
--- a/client/src/stager/stager_rm.c
+++ b/client/src/stager/stager_rm.c
@@ -98,8 +98,7 @@ int cmd_parse(int argc,
struct stage_filereq **reqs,
int* nbreqs,
struct stage_options* opts) {
- int nbfiles, Coptind, Copterr, errflg;
- char c;
+ int nbfiles, Coptind, Copterr, errflg, c;

/* Counting the number of HSM files */
if ((*nbreqs = cmd_countHsmFiles(argc, argv)) < 0) {
@@ -118,7 +117,7 @@ int cmd_parse(int argc,
nbfiles = 0;
while ((c = Cgetopt_long
(argc, argv, "M:f:S:ha", longopts, NULL)) != -1) {
- switch (c) {
+ switch ((char)c) {
case 'M':
(*reqs)[nbfiles].filename = Coptarg;
nbfiles++;
@@ -169,15 +168,14 @@ int cmd_parse(int argc,
* or -1 if an error occured
*/
int cmd_countHsmFiles(int argc, char *argv[]) {
- int Coptind, Copterr, errflg, nbargs;
- char c;
+ int Coptind, Copterr, errflg, nbargs, c;

Coptind = 1;
Copterr = 1;
errflg = 0;
nbargs = 0;
while ((c = Cgetopt_long (argc, argv, "S:M:f:ha", longopts, NULL)) != -1) {
- switch (c) {
+ switch ((char)c) {
case 'M':
nbargs++;;
break;
diff --git a/client/src/stager/stager_setFileGCWeight.c b/client/src/stager/stager_setFileGCWeight.c
index 6063fe4..3d97371 100644
--- a/client/src/stager/stager_setFileGCWeight.c
+++ b/client/src/stager/stager_setFileGCWeight.c
@@ -95,8 +95,7 @@ int cmd_parse(int argc,
char *argv[],
struct stage_filereq **reqs,
int* nbreqs, char **service_class, float *weight) {
- int nbfiles, Coptind, Copterr, errflg;
- char c;
+ int nbfiles, Coptind, Copterr, errflg, c;

/* Counting the number of HSM files */
if ((*nbreqs = cmd_countHsmFiles(argc, argv)) < 0) {
@@ -115,7 +114,7 @@ int cmd_parse(int argc,
nbfiles = 0;
while ((c = Cgetopt_long
(argc, argv, "M:S:h", longopts, NULL)) != -1) {
- switch (c) {
+ switch ((char)c) {
case 'M':
(*reqs)[nbfiles].filename = Coptarg;
nbfiles++;
@@ -153,15 +152,14 @@ int cmd_parse(int argc,
* or -1 if an error occured
*/
int cmd_countHsmFiles(int argc, char *argv[]) {
- int Coptind, Copterr, errflg, nbargs;
- char c;
+ int Coptind, Copterr, errflg, nbargs, c;

Coptind = 1;
Copterr = 1;
errflg = 0;
nbargs = 0;
while ((c = Cgetopt_long (argc, argv, "M:S:h", longopts, NULL)) != -1) {
- switch (c) {
+ switch ((char)c) {
case 'M':
nbargs++;;
break;
8 changes: 6 additions & 2 deletions castor.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Source: http://castorold.web.cern.ch/castorold/DIST/CERN/savannah/CASTOR.pkg/%{

Patch0: castor-2.1.13.6-fix-pthreads-darwin
Patch1: castor-2.1.13.6-fix-memset-in-showqueues
Patch2: castor-2.1.13.9-fix-arm-m32-option
Patch3: castor-2.1.13.9-fix-arm-type-limits

%if "%online" != "true"
Requires: libuuid
Expand All @@ -41,6 +43,8 @@ Provides: libshift.so.%(echo %realversion |cut -d. -f1,2)%{libsuffix}
%patch0 -p1
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1

case %cmsplatf in
*_gcc4[012345]*) ;;
Expand Down Expand Up @@ -70,13 +74,13 @@ find . -type f -exec touch {} \;

CASTOR_NOSTK=yes; export CASTOR_NOSTK
./configure
LDFLAGS="-L${LIBUUID_ROOT}/lib64" make %{makeprocesses} client
LDFLAGS="-L${LIBUUID_ROOT}/lib64" CXXFLAGS="-I${LIBUUID_ROOT}/include" make %{makeprocesses} client
%install
make installclient \
MAJOR_CASTOR_VERSION=%(echo %realversion | cut -d. -f1-2) \
MINOR_CASTOR_VERSION=%(echo %realversion | cut -d. -f3-4 | tr '-' '.' ) \
EXPORTLIB=/ \
DESTDIR=%i/ \
DESTDIR=%i \
PREFIX= \
CONFIGDIR=etc \
FILMANDIR=usr/share/man/man4 \
Expand Down

0 comments on commit 20f6afe

Please sign in to comment.