Solved

How do I compile this tool in Unix

Posted on 2010-09-16
16
680 Views
Last Modified: 2012-06-22
I am trying to compile the tool shown at the link below on my linux server but am experiencing problems.

http://code.google.com/p/uits/wiki/UITSWikiHome

I've uploaded the relevant files for Unix onto my server which includes a Makefile but when I run the command make I get the following message

make: *** No rule to make target `main.o', needed by `UITS_Tool'.  Stop.

Any help would be greatly appreciated.



0
Comment
Question by:albyh
  • 5
  • 4
  • 3
  • +2
16 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
Did you run "./configure" in the distribution directory before "make"?
wmp
0
 

Author Comment

by:albyh
Comment Utility
Yeah I just get

-bash: ./configure: No such file or directory
0
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
Anyway, your Makefile is incomplete.
Which OS do you use?
Seems that only for Mac OSX and Windows there is a straightforward way to build the tool.
wmp
0
 

Author Comment

by:albyh
Comment Utility
I've just tried reuploading the makefile to the server but I get the same error

I'm using CentOS.

That's the problem there's clear instructions for Win and Mac but not for Unix :-(
0
 
LVL 6

Expert Comment

by:LeeeRussell
Comment Utility
Is the configure file executable?

chmod +x configure
0
 

Author Comment

by:albyh
Comment Utility
There is no configure file
0
 
LVL 6

Expert Comment

by:LeeeRussell
Comment Utility
I don't know which file you've downloaded, but this zip:

uits-tool-0.01.zip

includes a few instructions for how to compile on unix in the README.  It might help.

Lee
0
 

Author Comment

by:albyh
Comment Utility
You mean this line "Under unix, type ./runUITS.sh".  Thats not instructions for how to complie it's just a test script to be run after the file is compiled.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 12

Expert Comment

by:HappyCactus
Comment Utility
have you tried to compile the tool by following the instruction for building on Mac OSX from commandline? MacOsX is a unix variant.
0
 

Author Comment

by:albyh
Comment Utility
The instructions for Mac OSX are to go to the directory and type make which is what I have done and get the error shown in the initial question
0
 
LVL 34

Expert Comment

by:Duncan Roe
Comment Utility
Are these the build instructions you were referring to?

BUILDING UITS_Tool   The UITS_Tool is written in C and has been compiled using the GNU C compiler on Mac   and Windows (MinGW). It uses three open source libraries. Compiled versions of those   libraries are distributed with the tool. To build in another environment, those   libraries must be re-compiled. The three libraries are:                                                           OpenSSL -  (http://www.openssl.org/) Version 1.0 beta4                                                           Libxml2 -  (http://xmlsoft.org/) Distributed with MacOSX                                                           Mini-XML - (http://www.minixml.org/)        To build under MacOSX using X-Code, use the xcode project,                uits-tool-osx-xcode/uits-tool-osx-xcode.xcodeproj        To build under MacOSX from the command line:                1. open a terminal window                2. cd to uits-tool-osx-make                3. make

There is indeed a Makefile in uits-tool-0.01/uits-tool-osx-make. Did you really cd there? However it needs a little TLC to function under Linux.
Firstly, at least at gcc (GCC) 4.4.4 there is no -arch i386 option, so remove that.
Secondly, you can not use the shipped .a libraries and must recompile them as per the instructions above.

On my system, I already have libxml2 and libssl. I fetched the source for libmxml. Will re-try build now.
0
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 250 total points
Comment Utility
It builds for me now. Does it work? - I have no idea. There are a number of warnings when compiling, but they may be all right (see below).
I have attached a patch file for you to update Makefile. Here's how to use it:-

Place the attached file Makefile.txt in the uits-tool-0.01/uits-tool-osx-make directory. cd there.
Type the command cat Makefile.txt | patch

Now make should work, as long as you have built and installed any of the required three libraries that weren't installed already.

gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o main.o ../source/main.c

../source/main.c: In function 'uitsGetOptCreate':

../source/main.c:386: warning: passing argument 2 of 'getopt_long' from incompatible pointer type

/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'

../source/main.c: In function 'uitsGetOptVerify':

../source/main.c:528: warning: passing argument 2 of 'getopt_long' from incompatible pointer type

/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'

../source/main.c: In function 'uitsGetOptExtract':

../source/main.c:628: warning: passing argument 2 of 'getopt_long' from incompatible pointer type

/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'

../source/main.c: In function 'uitsGetOptGenHash':

../source/main.c:718: warning: passing argument 2 of 'getopt_long' from incompatible pointer type

/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'

../source/main.c: In function 'uitsGetOptGenKey':

../source/main.c:785: warning: passing argument 2 of 'getopt_long' from incompatible pointer type

/usr/include/getopt.h:175: note: expected 'char * const*' but argument is of type 'const char **'

gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o uitsAudioFileManager.o ../source/uitsAudioFileManager.c

gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o uitsMP3Manager.o ../source/uitsMP3Manager.c

../source/uitsMP3Manager.c: In function 'lswap':

../source/uitsMP3Manager.c:1002: warning: assignment from incompatible pointer type

../source/uitsMP3Manager.c: In function 'llswap':

../source/uitsMP3Manager.c:1029: warning: assignment from incompatible pointer type

gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o uitsPayloadManager.o ../source/uitsPayloadManager.c

../source/uitsPayloadManager.c: In function 'uitsValidatePayloadSchema':

../source/uitsPayloadManager.c:983: warning: assignment from incompatible pointer type

../source/uitsPayloadManager.c:984: warning: passing argument 1 of 'xmlSchemaSetValidErrors' from incompatible pointer type

/usr/include/libxml2/libxml/xmlschemas.h:158: note: expected 'xmlSchemaValidCtxtPtr' but argument is of type 'xmlSchemaParserCtxtPtr'

../source/uitsPayloadManager.c:985: warning: passing argument 1 of 'xmlSchemaValidateDoc' from incompatible pointer type

/usr/include/libxml2/libxml/xmlschemas.h:182: note: expected 'xmlSchemaValidCtxtPtr' but argument is of type 'xmlSchemaParserCtxtPtr'

../source/uitsPayloadManager.c:990: warning: passing argument 1 of 'xmlSchemaFreeValidCtxt' from incompatible pointer type

/usr/include/libxml2/libxml/xmlschemas.h:180: note: expected 'xmlSchemaValidCtxtPtr' but argument is of type 'xmlSchemaParserCtxtPtr'

gcc -Os -g -I /usr/include/libxml2 -I openssl/include   -c -o uitsOpenSSL.o ../source/uitsOpenSSL.c

../source/uitsOpenSSL.c: In function 'uitsCreateDigest':

../source/uitsOpenSSL.c:131: warning: passing argument 3 of 'uitsHandleErrorPTR' discards qualifiers from pointer target type

../source/uits.h:61: note: expected 'void *' but argument is of type 'const struct EVP_MD *'

../source/uitsOpenSSL.c: In function 'uitsCreateDigestBuffered':

../source/uitsOpenSSL.c:185: warning: passing argument 3 of 'uitsHandleErrorPTR' discards qualifiers from pointer target type

../source/uits.h:61: note: expected 'void *' but argument is of type 'const struct EVP_MD *'

../source/uitsOpenSSL.c: In function 'uitsCreateSignature':

../source/uitsOpenSSL.c:290: warning: assignment discards qualifiers from pointer target type

../source/uitsOpenSSL.c:292: warning: assignment discards qualifiers from pointer target type

../source/uitsOpenSSL.c: In function 'uitsVerifySignature':

../source/uitsOpenSSL.c:381: warning: passing argument 3 of 'uitsHandleErrorPTR' discards qualifiers from pointer target type

../source/uits.h:61: note: expected 'void *' but argument is of type 'const struct EVP_MD *'

gcc -Os -g -o UITS_Tool   main.o uitsAudioFileManager.o uitsMP3Manager.o uitsPayloadManager.o uitsOpenSSL.o -lmxml -lxml2 -lcrypto -lssl -lpthread

Open in new window

Makefile.txt
0
 
LVL 34

Expert Comment

by:Duncan Roe
Comment Utility
Having applied the patch, it might be best to change the line in Makefile that reads:

CFLAGS  = $(OPTIM) -I /usr/include/libxml2 -I openssl/include

to

CFLAGS  = $(OPTIM) -I /usr/include/libxml2 -I /usr/include/openssl

That way, you use the header file that exactly matches the ssl library you are now using. It doesn't change any compiler warnings though
0
 
LVL 12

Expert Comment

by:HappyCactus
Comment Utility
The warnings are pretty innocuous, only bad programming practice (they could be removed easily).

0
 
LVL 34

Expert Comment

by:Duncan Roe
Comment Utility
Yes that's what I thought but I normally have a zero-tolerance policy towards warnings hence "may be all right".
0
 
LVL 12

Expert Comment

by:HappyCactus
Comment Utility
Me too ;-)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Is init file for an application part of rpm 3 38
check failing on yum update 5 29
„dd“ vs „ddrescue“ 28 198
KVM vs  Qemu 4 100
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now