From owner-freebsd-questions@FreeBSD.ORG Wed Dec 6 12:31:28 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2DF316A4FB for ; Wed, 6 Dec 2006 12:31:28 +0000 (UTC) (envelope-from koushikn@pubbox.net) Received: from pubbox.net (pubbox.net [81.169.167.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A69E43E80 for ; Wed, 6 Dec 2006 12:18:43 +0000 (GMT) (envelope-from koushikn@pubbox.net) Received: from [59.88.7.84] (helo=pubbox.net) by pubbox.net with esmtpa (Exim 4.60 (FreeBSD)) (envelope-from ) id 1Grvk2-000Fiw-86; Wed, 06 Dec 2006 13:19:15 +0100 Date: Wed, 6 Dec 2006 17:48:56 +0530 From: Koushik Narayanan To: VeeJay Message-ID: <20061206121856.GA563@freebsd.home> Mail-Followup-To: VeeJay , FreeBSD-Questions References: <2cd0a0da0612051538n6dfc999es3c465c311365e487@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2cd0a0da0612051538n6dfc999es3c465c311365e487@mail.gmail.com> User-Agent: Mutt/1.4.2.1i Cc: FreeBSD-Questions Subject: Re: Makefile question... please help... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2006 12:31:28 -0000 On Wed, Dec 06, 2006 at 12:38:49AM +0100, VeeJay wrote: > Hi there, > > Is it possible to make configuration changes in Makefile to install a port > as per one's requirments? It is possible. But it is better to avoid as it gets overwritten when you cvsup or portsnap. > > I want to accomplish two tasks.... > > 1. I want to configure mysql port before installation with following > parameters: Could someone tell me that where in the Makefile, I need to put > these paramenters in order to get my required results? Makefile is at the > end of my message. For each of these options there are usually knobs to set at the command line. You can easily find out these knobs from the MakeFile. If there are no knobs for a particular option then AFAIK you have to change the Makefile. CONFIGURE_ARGS is the variable that holds all arguments that will be passed. You can add to it as you requre. > Required Configuration paramenters: > > --prefix=/usr/local/mysql > --with-mysqld-user=mysql > --with-unix-socket-path=/tmp/mysql.sock These three donot have any knobs AFAIK. So you have to change your Makefile. > --with-mysqld-ldflags=-all-static This one has a knob named BUILD_STATIC. So you could do make -DBUILD_STATIC install to add this configuration alone. > CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ > --without-debug \ > --without-readline \ > --without-libedit \ > --without-bench \ > --without-extra-tools \ > --with-libwrap \ > --with-mysqlfs \ > --with-vio \ > --with-low-memory \ > --with-comment='FreeBSD port: ${PKGNAME}' \ > --enable-thread-safe-client This is the CONFIGURE_ARGS variable. Modify it as you like. Donot forget the '\'at the end of each non terminating line. > .if defined(BUILD_STATIC) > CONFIGURE_ARGS+=--with-mysqld-ldflags=-all-static > .endif This is what I meant by a knob. If you pass -DBUILD_STATIC to make, this 'if' returns true and the extra option to CONFIGURE_ARGS is concatenated. You could also define BUILD_STATIC in your shell from which you run make. It has the same effect. When you change your Makefile, make sure to rename it to so that it survives a cvsup. HTH Koushik Narayanan