# Python



## tzoi516 (Dec 4, 2013)

I haven't programmed since the early 90's (C/C++ and BASIC), and it was all via an IDE. I toyed with Python briefly to use QuARK on Windows. Since x11/avant-window-navigator hasn't been updated to the current version I want to build it myself. What I would like is just someone to point me in the right direction. I do have lang/python27 installed, but I'm getting this error:


```
configure: error: 
  Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
  ============================================================================
   ERROR!
   You probably have to install the development version of the Python package
   for your distribution.  The exact name of this package varies among them.
  ============================================================================

See `config.log' for more details
```

config.log shows autoconf automake and autoheader can't be found. I'm working out of a temporary directory. Thanks.


----------



## roddierod (Dec 4, 2013)

Maybe

```
LDFLAGS="-L/usr/local/lib/python2.7
```
It's not really a Python error but a linker error.


----------



## tzoi516 (Dec 5, 2013)

This worked: `./configure LDFLAGS="-L/usr/bin/python`

This is config.log (I haven't combed through it yet to see what the error(s) is/are):

```
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by avant-window-navigator configure 0.4.2, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure LDFLAGS=/usr/bin/python

## --------- ##
## Platform. ##
## --------- ##

hostname = lpnix002.local
uname -m = amd64
uname -r = 10.0-BETA4
uname -s = FreeBSD
uname -v = FreeBSD 10.0-BETA4 #0 r258774: Sun Dec  1 00:51:31 UTC 2013     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC 

/usr/bin/uname -p = amd64
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /sbin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /usr/games
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /root/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2656: checking for a BSD-compatible install
configure:2724: result: /usr/bin/install -c
configure:2735: checking whether build environment is sane
configure:2790: result: yes
configure:2941: checking for a thread-safe mkdir -p
configure:2980: result: ./install-sh -c -d
configure:2987: checking for gawk
configure:3017: result: no
configure:2987: checking for mawk
configure:3017: result: no
configure:2987: checking for nawk
configure:3003: found /usr/bin/nawk
configure:3014: result: nawk
configure:3025: checking whether make sets $(MAKE)
configure:3047: result: yes
configure:3076: checking whether make supports nested variables
configure:3093: result: yes
configure:3182: checking whether UID '0' is supported by ustar format
configure:3185: result: yes
configure:3192: checking whether GID '0' is supported by ustar format
configure:3195: result: yes
configure:3203: checking how to create a ustar tar archive
configure:3214: tar --version
bsdtar 3.1.2 - libarchive 3.1.2
configure:3217: $? = 0
configure:3257: tardir=conftest.dir && eval tar --format=ustar -chf - "$tardir" >conftest.tar
configure:3260: $? = 0
configure:3264: tar -xf - <conftest.tar
configure:3267: $? = 0
configure:3269: cat conftest.dir/file
GrepMe
configure:3272: $? = 0
configure:3285: result: gnutar
configure:3294: checking whether to enable maintainer-specific portions of Makefiles
configure:3303: result: no
configure:3332: checking for style of include used by make
configure:3360: result: GNU
configure:3431: checking for gcc
configure:3461: result: no
configure:3524: checking for cc
configure:3545: found /usr/bin/cc
configure:3568: result: cc
configure:3687: checking for C compiler version
configure:3696: cc --version >&5
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: x86_64-unknown-freebsd10.0
Thread model: posix
configure:3707: $? = 0
configure:3696: cc -v >&5
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: x86_64-unknown-freebsd10.0
Thread model: posix
configure:3707: $? = 0
configure:3696: cc -V >&5
cc: error: argument to '-V' is missing (expected 1 value)
cc: error: no input files
configure:3707: $? = 1
configure:3696: cc -qversion >&5
cc: error: no input files
configure:3707: $? = 1
configure:3727: checking whether the C compiler works
configure:3749: cc   /usr/bin/python conftest.c  >&5
cc: error: no such file or directory: '/usr/bin/python'
configure:3753: $? = 1
configure:3791: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "avant-window-navigator"
| #define PACKAGE_TARNAME "avant-window-navigator"
| #define PACKAGE_VERSION "0.4.2"
| #define PACKAGE_STRING "avant-window-navigator 0.4.2"
| #define PACKAGE_BUGREPORT "https://bugs.launchpad.net/awn"
| #define PACKAGE_URL ""
| #define EXTRA_VERSION ""
| #define PACKAGE "avant-window-navigator"
| #define VERSION "0.4.2"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3796: error: in `/tmp/awn':
configure:3799: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_AWN_CFLAGS_set=''
ac_cv_env_AWN_CFLAGS_value=''
ac_cv_env_AWN_LIBS_set=''
ac_cv_env_AWN_LIBS_value=''
ac_cv_env_CCC_set=''
ac_cv_env_CCC_value=''
ac_cv_env_CC_set=''
ac_cv_env_CC_value=''
ac_cv_env_CFLAGS_set=''
ac_cv_env_CFLAGS_value=''
ac_cv_env_CPPFLAGS_set=''
ac_cv_env_CPPFLAGS_value=''
ac_cv_env_CPP_set=''
ac_cv_env_CPP_value=''
ac_cv_env_CXXCPP_set=''
ac_cv_env_CXXCPP_value=''
ac_cv_env_CXXFLAGS_set=''
ac_cv_env_CXXFLAGS_value=''
ac_cv_env_CXX_set=''
ac_cv_env_CXX_value=''
ac_cv_env_DOCK_CFLAGS_set=''
ac_cv_env_DOCK_CFLAGS_value=''
ac_cv_env_DOCK_LIBS_set=''
ac_cv_env_DOCK_LIBS_value=''
ac_cv_env_GTKDOC_DEPS_CFLAGS_set=''
ac_cv_env_GTKDOC_DEPS_CFLAGS_value=''
ac_cv_env_GTKDOC_DEPS_LIBS_set=''
ac_cv_env_GTKDOC_DEPS_LIBS_value=''
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=/usr/bin/python
ac_cv_env_LIBS_set=''
ac_cv_env_LIBS_value=''
ac_cv_env_PKG_CONFIG_LIBDIR_set=''
ac_cv_env_PKG_CONFIG_LIBDIR_value=''
ac_cv_env_PKG_CONFIG_PATH_set=''
ac_cv_env_PKG_CONFIG_PATH_value=''
ac_cv_env_PKG_CONFIG_set=''
ac_cv_env_PKG_CONFIG_value=''
ac_cv_env_PYGTK_CFLAGS_set=''
ac_cv_env_PYGTK_CFLAGS_value=''
ac_cv_env_PYGTK_LIBS_set=''
ac_cv_env_PYGTK_LIBS_value=''
ac_cv_env_PYTHON_set=''
ac_cv_env_PYTHON_value=''
ac_cv_env_TASKMANAGER_CFLAGS_set=''
ac_cv_env_TASKMANAGER_CFLAGS_value=''
ac_cv_env_TASKMANAGER_LIBS_set=''
ac_cv_env_TASKMANAGER_LIBS_value=''
ac_cv_env_build_alias_set=''
ac_cv_env_build_alias_value=''
ac_cv_env_host_alias_set=''
ac_cv_env_host_alias_value=''
ac_cv_env_target_alias_set=''
ac_cv_env_target_alias_value=''
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=nawk
ac_cv_prog_CC=cc
ac_cv_prog_make_make_set=yes
am_cv_make_support_nested_variables=yes
am_cv_prog_tar_ustar=gnutar

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /tmp/awn/missing aclocal-1.13'
ACLOCAL_AMFLAGS='${ACLOCAL_FLAGS}'
ALL_LINGUAS=''
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_MAKEFLAGS=''
AM_V='$(V)'
APPLETSDIR=''
AR=''
AUTOCONF='${SHELL} /tmp/awn/missing autoconf'
AUTOHEADER='${SHELL} /tmp/awn/missing autoheader'
AUTOMAKE='${SHELL} /tmp/awn/missing automake-1.13'
AWK='nawk'
AWN_CFLAGS=''
AWN_LIBS=''
CATALOGS=''
CATOBJEXT=''
CC='cc'
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DATADIR=''
DATADIRNAME=''
DBUS_GLIB_BIN=''
DEFS=''
DEPDIR='.deps'
DISABLE_DEPRECATED_FLAGS=''
DLLTOOL=''
DOCK_CFLAGS=''
DOCK_LIBS=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_GTK_DOC_FALSE=''
ENABLE_GTK_DOC_TRUE=''
EXEEXT=''
EXTRA_VERSION=''
F77=''
FC=''
FGREP=''
GCONFTOOL=''
GCONF_SCHEMAS_INSTALL_FALSE=''
GCONF_SCHEMAS_INSTALL_TRUE=''
GCONF_SCHEMA_CONFIG_SOURCE=''
GCONF_SCHEMA_FILE_DIR=''
GETTEXT_PACKAGE=''
GLIB_GENMARSHAL=''
GMOFILES=''
GMSGFMT=''
GREP=''
GTKDOC_CHECK=''
GTKDOC_DEPS_CFLAGS=''
GTKDOC_DEPS_LIBS=''
GTKDOC_MKPDF=''
GTKDOC_REBASE=''
GTK_DOC_BUILD_HTML_FALSE=''
GTK_DOC_BUILD_HTML_TRUE=''
GTK_DOC_BUILD_PDF_FALSE=''
GTK_DOC_BUILD_PDF_TRUE=''
GTK_DOC_USE_LIBTOOL_FALSE=''
GTK_DOC_USE_LIBTOOL_TRUE=''
GTK_DOC_USE_REBASE_FALSE=''
GTK_DOC_USE_REBASE_TRUE=''
HTML_DIR=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
INSTOBJEXT=''
INTLLIBS=''
INTLTOOL_CAVES_RULE=''
INTLTOOL_DESKTOP_RULE=''
INTLTOOL_DIRECTORY_RULE=''
INTLTOOL_EXTRACT=''
INTLTOOL_KBD_RULE=''
INTLTOOL_KEYS_RULE=''
INTLTOOL_MERGE=''
INTLTOOL_OAF_RULE=''
INTLTOOL_PERL=''
INTLTOOL_POLICY_RULE=''
INTLTOOL_PONG_RULE=''
INTLTOOL_PROP_RULE=''
INTLTOOL_SCHEMAS_RULE=''
INTLTOOL_SCHEMA_INI_RULE=''
INTLTOOL_SERVER_RULE=''
INTLTOOL_SERVICE_RULE=''
INTLTOOL_SHEET_RULE=''
INTLTOOL_SOUNDLIST_RULE=''
INTLTOOL_THEME_RULE=''
INTLTOOL_UI_RULE=''
INTLTOOL_UPDATE=''
INTLTOOL_V_MERGE=''
INTLTOOL_V_MERGE_OPTIONS=''
INTLTOOL_XAM_RULE=''
INTLTOOL_XML_NOMERGE_RULE=''
INTLTOOL_XML_RULE=''
INTLTOOL__v_MERGE_0=''
INTLTOOL__v_MERGE_=''
LD=''
LDA_BINDIR=''
LDA_DEFSDIR=''
LDA_VAPIDIR=''
LDFLAGS='/usr/bin/python'
LIBAPPLETDIR=''
LIBDIR=''
LIBOBJS=''
LIBRARY_MODULES=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LOCALEDIR=''
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEFLAGS=''
MAKEINFO='${SHELL} /tmp/awn/missing makeinfo'
MANIFEST_TOOL=''
MKDIR_P='./install-sh -c -d'
MKINSTALLDIRS=''
MSGFMT=''
MSGFMT_OPTS=''
MSGMERGE=''
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='avant-window-navigator'
PACKAGE_BUGREPORT='https://bugs.launchpad.net/awn'
PACKAGE_NAME='avant-window-navigator'
PACKAGE_STRING='avant-window-navigator 0.4.2'
PACKAGE_TARNAME='avant-window-navigator'
PACKAGE_URL=''
PACKAGE_VERSION='0.4.2'
PATH_SEPARATOR=':'
PKGDATADIR=''
PKG_CONFIG=''
PKG_CONFIG_LIBDIR=''
PKG_CONFIG_PATH=''
POFILES=''
POSUB=''
PO_IN_DATADIR_FALSE=''
PO_IN_DATADIR_TRUE=''
PYGTK_CFLAGS=''
PYGTK_DEFSDIR=''
PYGTK_LIBS=''
PYG_CODEGEN=''
PYTHON=''
PYTHON_CPPFLAGS=''
PYTHON_EXEC_PREFIX=''
PYTHON_EXTRA_LDFLAGS=''
PYTHON_EXTRA_LIBS=''
PYTHON_LDFLAGS=''
PYTHON_PLATFORM=''
PYTHON_PREFIX=''
PYTHON_VERSION=''
Q=''
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STANDARD_CPPFLAGS=''
STRIP=''
TASKMANAGER_CFLAGS=''
TASKMANAGER_LIBS=''
USE_NLS=''
V=''
VALAC=''
VALA_GEN_INTROSPECT=''
VAPIGEN=''
VERSION='0.4.2'
WARNING_FLAGS=''
XGETTEXT=''
ac_ct_AR=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='tar --format=ustar -chf - "$$tardir"'
am__untar='tar -xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /tmp/awn/install-sh'
intltool__v_merge_options_0=''
intltool__v_merge_options_=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localedir_intermediate=''
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
pkgpyexecdir=''
pkgpythondir=''
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
pyexecdir=''
pythondir=''
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
shavedir=''
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "avant-window-navigator"
#define PACKAGE_TARNAME "avant-window-navigator"
#define PACKAGE_VERSION "0.4.2"
#define PACKAGE_STRING "avant-window-navigator 0.4.2"
#define PACKAGE_BUGREPORT "https://bugs.launchpad.net/awn"
#define PACKAGE_URL ""
#define EXTRA_VERSION ""
#define PACKAGE "avant-window-navigator"
#define VERSION "0.4.2"

configure: exit 77
```

UPDATE: It says the C compiler doesn't work - while I have clang set in my make.conf.


----------



## SirDice (Dec 5, 2013)

tzoi516 said:
			
		

> I Since x11/avant-window-navigator hasn't been updated to the current version I want to build it myself.


What I usually try to do, when there's already a port for it, is to simply edit the port's Makefile and change the version numbers. Then see if it would build. A lot of the times you can use the existing port. That will save you some time in finding the correct compiler/linker options as they're probably already set correctly. Unless of course the application has been changed a lot upstream. But it should provide you with a good base to work from.

Moved to "porting new software".


----------



## tzoi516 (Dec 5, 2013)

I changed the Makefile and distinfo. However the error is that it can't find the file, so I manually downloaded it. Now it asks for 


```
File to patch:
```

I downloaded a patch file from FreshPorts, but so far no luck.


----------



## roddierod (Dec 5, 2013)

```
cc: error: no input files
configure:3707: $? = 1
configure:3727: checking whether the C compiler works
configure:3749: cc   /usr/bin/python conftest.c  >&5
cc: error: no such file or directory: '/usr/bin/python'
```

If you installed Python from ports or package it should be /usr/local/bin/python.


----------



## tzoi516 (Dec 5, 2013)

I ran `ldconfig -r | grep python` and this is what I have:

```
283:-lpytalloc-util.2 => /usr/local/lib/libpytalloc-util.so.2
	329:-lpyglib-2.0-python2.7.0 => /usr/local/lib/libpyglib-2.0-python2.7.so.0
	496:-lpython2.7.1 => /usr/local/lib/libpython2.7.so.1
```
I tried all paths with and without files. I found a patch from the mailing list, but don't know which file to patch when prompted.


----------



## tzoi516 (Dec 5, 2013)

Finally I'm getting somewhere, at least. I ran `./configure LDFLAGS="/usr/local/lib` with this result:

```
Script started on Thu Dec  5 14:14:25 2013
root@lpnix002:/tmp/awn # ./configure LDFLAGS="/usr/local/lib"

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... no
checking for cc... cc
checking whether the C compiler works... no
configure: error: in `/tmp/awn':
configure: error: C compiler cannot create executables
See `config.log' for more details
root@lpnix002:/tmp/awn # exit

exit

Script done on Thu Dec  5 14:14:56 2013
```


----------

