Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-r.one.com (mx-r.one.com [91.198.169.249])
	by mail6.local.one.com (Postfix) with ESMTP id D4B9A3002E69C3
	for <filtered@awaresystems.be>; Tue,  7 Oct 2014 23:16:32 +0000 (UTC)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-r: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.220.46 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46])
	by mx-r.one.com (Postfix) with ESMTP id 6959D20780841
	for <filtered@awaresystems.be>; Tue,  7 Oct 2014 23:16:32 +0000 (UTC)
Received: by mail-pa0-f46.google.com with SMTP id fa1so7928386pad.19
        for <filtered@awaresystems.be>; Tue, 07 Oct 2014 16:16:31 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-original-authentication-results:delivered-to:delivered-to:from:to
         :thread-topic:thread-index:date:message-id:references:in-reply-to
         :accept-language:content-language:mime-version:cc:subject:precedence
         :list-id:list-unsubscribe:list-archive:list-post:list-help
         :list-subscribe:content-type:content-transfer-encoding:sender
         :errors-to;
        bh=hVxRJ5cxNDlCKk/1iVHc5Ew/K9V+E+pa2/GxK6KEFpM=;
        b=jd9PQSSlEMesrUrWG4edrv7JY/IgsnRH49AVNznMGp5v+93vGR7D33tDfzYu2q2H99
         qwX3J4aqVvxE7RThNkpRUirtw0BKW74vhq5tJweuwjnZ5V4ZIbn/j+h/UULvSY3sFKva
         1TR/dboC6CZ3u8NObVqfTDoHJtUDVT3wCnu0DxA66qXOh0z5AxNd3tmX/J896bdjKVwE
         d//cJkYm9k+/qAVy+0KeJNAMKUTiC93gzXsMVFhzNRZSpZKiEUk8AhDNgiyEWAFTu7mb
         JfeGS/qwK+I1MknTS/Z1WHu8d/MxT7QT726b0QAGZEvsVgZQixQbFaaHrUryDSailWJm
         e26Q==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
X-Received: by 10.69.26.74 with SMTP id iw10mr6437532pbd.137.1412723790925;
        Tue, 07 Oct 2014 16:16:30 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.70.8.194 with SMTP id t2csp130375pda;
        Tue, 7 Oct 2014 16:16:30 -0700 (PDT)
X-Received: by 10.66.65.130 with SMTP id x2mr6507451pas.79.1412723789922;
        Tue, 07 Oct 2014 16:16:29 -0700 (PDT)
Authentication-Results: mx.google.com;
       spf=neutral (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
Received-SPF: none (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) client-ip=91.198.169.63;
Received: by 10.66.184.139 with POP3 id eu11mf546747pac.30;
        Tue, 07 Oct 2014 16:16:29 -0700 (PDT)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-p.one.com (mx-p.one.com [91.198.169.63])
	by mail6.local.one.com (Postfix) with ESMTP id F09263002E69C1
	for <info@awaresystems.be>; Tue,  7 Oct 2014 22:32:06 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (ks365428.kimsufi.com [94.23.4.142])
	by mx-p.one.com (Postfix) with ESMTP id C7F734164164D
	for <info@awaresystems.be>; Tue,  7 Oct 2014 22:32:06 +0000 (UTC)
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id D60A135C03A;
	Tue,  7 Oct 2014 17:31:20 -0500 (EST)
Received: from na01-bl2-obe.outbound.protection.outlook.com
	(mail-bl2on0058.outbound.protection.outlook.com [65.55.169.58])
	by lists.maptools.org (Postfix) with ESMTPS id 0F2CE35C035
	for <tiff@lists.maptools.org>; Tue,  7 Oct 2014 17:30:58 -0500 (EST)
Received: from DM2PR0301MB1246.namprd03.prod.outlook.com (25.160.219.23) by
	DM2PR0301MB1245.namprd03.prod.outlook.com (25.160.219.22) with
	Microsoft SMTP
	Server (TLS) id 15.0.1044.10; Tue, 7 Oct 2014 22:31:01 +0000
Received: from DM2PR0301MB1246.namprd03.prod.outlook.com ([25.160.219.23]) by
	DM2PR0301MB1246.namprd03.prod.outlook.com ([25.160.219.23]) with
	mapi id 15.00.1044.008; Tue, 7 Oct 2014 22:31:01 +0000
From: Joel Costigliola <joel.costigliola@orionhealth.com>
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Thread-Topic: [Tiff] build a static tiff2pdf
Thread-Index: AQHP4eiSj0nJg7/sIEGzhWsfOYA+R5wktNGAgAB+0lU=
Date: Tue, 7 Oct 2014 22:30:59 +0000
Message-ID: <1412721054740.72927@orionhealth.com>
References: <1412657434147.53619@orionhealth.com>,
	<alpine.GSO.2.01.1410070934280.18732@freddy.simplesystems.org>
In-Reply-To: <alpine.GSO.2.01.1410070934280.18732@freddy.simplesystems.org>
Accept-Language: en-NZ, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [202.37.75.130]
x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1245;
x-forefront-prvs: 035748864E
x-forefront-antispam-report: SFV:NSPM;
	SFS:(10009020)(6009001)(24454002)(377454003)(199003)(189002)(51704005)(54356999)(15975445006)(99396003)(15202345003)(92726001)(36756003)(107046002)(87936001)(19580395003)(19580405001)(76176999)(92566001)(46102003)(64706001)(86362001)(40100002)(50986999)(120916001)(66066001)(101416001)(110136001)(77096002)(106116001)(105586002)(31966008)(85306004)(20776003)(117636001)(80022003)(76482002)(85852003)(21056001)(97736003)(95666004)(2656002)(122556002)(106356001)(4396001)(18886065003);
	DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB1245;
	H:DM2PR0301MB1246.namprd03.prod.outlook.com; FPR:; MLV:sfv;
	PTR:InfoNoRecords; A:1; MX:1; LANG:en; 
MIME-Version: 1.0
X-OriginatorOrg: orionhealth.com
Cc: "tiff@lists.maptools.org" <tiff@lists.maptools.org>
Subject: Re: [Tiff] build a static tiff2pdf
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

I finally managed to build a static version of tiff2pdf.

I ran first:
 ./configure --prefix=/home/joelco/prog/tiff2pdf/ --enable-shared=no LIBS='/usr/local/lib/libjpeg.a' --enable-static

But it was not enough to have a static version, the static option was not present in the final libtool command : 

/bin/bash ../libtool  --tag=CC   --mode=link gcc -static  -g -O2 -Wall -W  -static -o tiff2pdf tiff2pdf.o ../libtiff/libtiff.la ../port/libport.la -ljpeg -lm /usr/local/lib/libjpeg.a
libtool: link: gcc -g -O2 -Wall -W -o tiff2pdf tiff2pdf.o  ../libtiff/.libs/libtiff.a ../port/.libs/libport.a -ljpeg -lm /usr/local/lib/libjpeg.a

So I just ran the link command manually adding the static option:
gcc -g -O2 -Wall -W -static -o tiff2pdf tiff2pdf.o  ../libtiff/.libs/libtiff.a ../port/.libs/libport.a -ljpeg -lm /usr/local/lib/libjpeg.a

It's not the cleanest way of building a static binary but at least it worked.

Cheers,

Joel

________________________________________
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Sent: Wednesday, 8 October 2014 03:38 a.m.
To: Joel Costigliola
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] build a static tiff2pdf

On Tue, 7 Oct 2014, Joel Costigliola wrote:

>
> Hey,
>
> I'm trying to build a static binaries, to embedd tiff2pdf in my java application.
>
> I'm running Ubuntu 14.04, I have been able to build a tiff2pdf binary using shared libraries but I failed to build a
> static one.

You don't really want to build a static libtiff.  Modern systems
depend on shared libraries so that binaries can run on multiple
systems.  The only library which looks like a problem in your linkage
is libjpeg.so.7.

Perhaps using

   ./configure LIBS='/usr/lib/x86_64-linux-gnu/libjpeg.a'

(adapted for your system) might help with the JPEG linkage problem.

Otherwise you will need to learn about exotic linker options.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
