From owner-freebsd-ports Fri Jun 22 10:48:42 2001 Delivered-To: freebsd-ports@freebsd.org Received: from london.physics.purdue.edu (london.physics.purdue.edu [128.210.67.35]) by hub.freebsd.org (Postfix) with ESMTP id 1D2EB37B406; Fri, 22 Jun 2001 10:48:38 -0700 (PDT) (envelope-from will@physics.purdue.edu) Received: from bohr.physics.purdue.edu (bohr.physics.purdue.edu [128.210.67.12]) by london.physics.purdue.edu (8.8.8/8.8.8) with ESMTP id MAA28830; Fri, 22 Jun 2001 12:48:37 -0500 (EST) Received: by bohr.physics.purdue.edu (Postfix, from userid 12409) id 739C25BB5; Fri, 22 Jun 2001 12:48:37 -0500 (EST) Date: Fri, 22 Jun 2001 12:48:37 -0500 From: Will Andrews To: Joe Glass Cc: will@FreeBSD.org, ports@FreeBSD.org Subject: Re: FreeBSD Port: qt-2.3.0 Message-ID: <20010622124837.G74316@bohr.physics.purdue.edu> Reply-To: Will Andrews Mail-Followup-To: Joe Glass , will@FreeBSD.org, ports@FreeBSD.org References: <3B335A83.F4B91BCC@glass.cl.msu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.17i In-Reply-To: <3B335A83.F4B91BCC@glass.cl.msu.edu>; from joe@glass.cl.msu.edu on Fri, Jun 22, 2001 at 10:47:31AM -0400 X-Operating-System: FreeBSD 4.3-STABLE i386 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, Jun 22, 2001 at 10:47:31AM -0400, Joe Glass (joe@glass.cl.msu.edu) wrote: > Hi Will, I'm having a lot of trouble compiling KDE applications on my > FreeBSD 4.3 box. It seems like none of them know where any of the Qt > files are. When I compile, I'm trying ./configure > --with-qt-includes=/usr/X11R6/include/qt2 > --with-qt-libraries=/usr/X11R6/lib. I sometimes also have to set the > MOC variable to the full path to moc2. Are the above the right step > towards compiling KDE applications, or am I doing this wrong? Also, it > seems the paths for qt23 are not standard, I'm curious to why they are? Hi Joe, You have to realize that the configure arguments aren't enough. If you look at ports/Mk/bsd.kde.mk, you'll notice that there's a lot of other stuff there, most notably configure environment vars. That's the most common mistake people make -- they assume (and probably rightfully) that they only need arguments, but you also need environment variables set when running configure. So, if you also look at ports/Mk/bsd.port.mk, you'll see that configure is run like this: do-configure: .if defined(USE_AUTOMAKE) @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOMAKE_ENV} ${AUTOMAKE} \ ${AUTOMAKE_ARGS}) .endif .if defined(USE_AUTOCONF) @(cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOCONF_ENV} ${AUTOCONF} \ ${AUTOCONF_ARGS}) .endif @if [ -f ${SCRIPTDIR}/configure ]; then \ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \ ${SCRIPTDIR}/configure; \ fi .if defined(HAS_CONFIGURE) @(cd ${CONFIGURE_WRKSRC} && \ if ! ${SETENV} CC="${CC}" CXX="${CXX}" \ CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" \ INSTALL="/usr/bin/install -c -o ${BINOWN} -g ${BINGRP}" \ INSTALL_DATA="${INSTALL_DATA}" \ INSTALL_PROGRAM="${INSTALL_PROGRAM}" \ INSTALL_SCRIPT="${INSTALL_SCRIPT}" \ ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}; then \ ${ECHO} "===> Script \"${CONFIGURE_SCRIPT}\" failed: here are the contents of \"${CONFIGURE_LOG}\""; \ ${CAT} ${CONFIGURE_LOG}; \ ${ECHO} "(end of \"${CONFIGURE_LOG}\")"; \ ${FALSE}; \ fi) .endif .if defined(PERL_CONFIGURE) @cd ${CONFIGURE_WRKSRC} && \ ${SETENV} ${CONFIGURE_ENV} \ ${PERL5} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} .endif .if defined(USE_IMAKE) @(cd ${CONFIGURE_WRKSRC}; ${SETENV} ${MAKE_ENV} ${XMKMF}) .endif .endif So, as you can see, the various GNU utilities are run in sequential order as needed (this varies for each port, but for most only HAS_CONFIGURE section is required). And as you can see, the part I'm trying to point out is: ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS} Where, for any and (nearly) all QT2-based apps: CONFIGURE_ARGS+=--with-qt-includes=${X11BASE}/include/qt2 \ --with-qt-libraries=${X11BASE}/lib \ --with-extra-libs=${LOCALBASE}/lib CONFIGURE_ENV+= MOC="${MOC}" LIBQT="-l${QTNAME}" \ CPPFLAGS="${QTCPPFLAGS}" LIBS="${QTCFGLIBS}" QTCPPFLAGS+= -I/usr/include -D_GETOPT_H -D_PTH_H_ -D_PTH_PTHREAD_H_ \ -I${LOCALBASE}/include -I${PREFIX}/include -I${X11BASE}/include/qt2 QTCFGLIBS+= -Wl,-export-dynamic -L${LOCALBASE}/lib -L${X11BASE}/lib -ljpeg -lgcc -lstdc++ If you look at these vars closely you'll notice that QT{CPPFLAGS,CFGLIBS} are not generally port variables. They're specially designed for QT2-based apps. Some QT2-based apps don't use this consistently broken style and os you may need to remove these variables, replacing them with whatever is appropriate. See QT_NONSTANDARD in ports/Mk/bsd.kde.mk. Also, notice these are all referred with '+=' not '='. That's because the port may have some others defined already, so first we define QT{CPPFLAGS,CFGLIBS}?= (blank variable) to allow QT_NONSTANDARD to work properly. The -D_PTH_* stuff is to prevent conflicts with some really stupidly constructed pthreads-ish ports. -D_GETOPT_H is for the libgnugetopt port. Anyways, that's the gist of qt/kde support. I mainly hacked it together in few days based on about two years' experience with the various qt/kde stuff, and this is the "API" to create ports based on QT/QT2/KDE/KDE2 applications -- right in bsd.kde.mk. Oh, and the reason why they're nonstandard.. is because in FreeBSD, we install things in organized ways. Libraries go where libraries go, headers go where headers go, binaries go where binaries go.. not everything for one package under a prefix. See hier(7) for more information. Woo, that was long. I should throw this message in some documentation file somewhere. Hopefully I've helped you too. -- wca To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message