@@ -4,13 +4,13 @@ AC_PREREQ([2.69])
44# -------------------------------------------
55# PackageTimestamp, major version, minor version, and Nameslist.txt version
66# Libraries have a "package" version of the form major.minor.micro.
7- m4_define ( [ uninameslist_package_stamp] , [ 20250714 ] ) dnl yyyymmdd
8- m4_define ( [ uninameslist_major_version] , [ 16 ] ) dnl Nameslist.txt
9- m4_define ( [ uninameslist_minor_version] , [ 9 ] )
7+ m4_define ( [ uninameslist_package_stamp] , [ 20250909 ] ) dnl yyyymmdd
8+ m4_define ( [ uninameslist_major_version] , [ 17 ] ) dnl Nameslist.txt
9+ m4_define ( [ uninameslist_minor_version] , [ 0 ] )
1010m4_define ( [ uninameslist_nameslist_ver] , [ uninameslist_major_version.uninameslist_minor_version] )
1111# Libraries have a "libtool" version of the form current:revision:age.
1212m4_define ( [ uninameslist_current] , [ 1] )
13- m4_define ( [ uninameslist_revision] ,[ 15 ] )
13+ m4_define ( [ uninameslist_revision] ,[ 16 ] )
1414m4_define ( [ uninameslist_age] , [ 0] )
1515m4_define ( [ uninameslist_libver] ,
1616 [ uninameslist_current:uninameslist_revision:uninameslist_age] )
@@ -77,6 +77,8 @@ AC_PROG_LN_S
7777AC_PROG_MKDIR_P
7878AC_PROG_MAKE_SET
7979AC_PROG_SED
80+ AC_CHECK_TOOL ( [ PYTHON2] ,[ python2] ,[ :] )
81+ AC_CHECK_TOOL ( [ PYTHON3] ,[ python3] ,[ :] )
8082AC_CHECK_TOOL ( [ WGET] ,[ wget] ,[ :] )
8183AC_CHECK_TOOL ( [ STRIP] ,[ strip] ,[ :] )
8284AC_CHECK_TOOL ( [ TOUCH] ,[ touch] ,[ :] )
117119
118120# -------------------------------------------
119121# Python lib building - as installable wheel
122+ # default is Python3 (otherwise try Python2)
120123AC_ARG_ENABLE ( [ pylib] ,
121124 [ AS_HELP_STRING ( [ --enable-pylib] ,
122125 [ Build the python module as an installable wheel.] ) ] ,
123126 [ enable_pylib=yes] , [ enable_pylib=no] )
127+ PYTHONx="no python"
124128if test x$enable_pylib = xyes ; then
125- AC_ARG_VAR ( [ PYTHON] ,[ Python to use to build the python wheel.] )
126- if test x"${PYTHON}" = x; then
127- PYTHON=python3
128- fi
129- AC_CHECK_PROG ( [ PYTHONFOUND] ,[ ${PYTHON}] ,[ yes] )
130- if test x"${PYTHONFOUND}" != xyes; then
131- AC_MSG_ERROR ( [ ${PYTHON} was not found] )
129+ # AC_ARG_VAR([PYTHON],[Python to use to build the python wheel.])
130+ PYTHONx=python3
131+ if test x"${PYTHON3}" = "x:"; then
132+ PYTHONx=python2
133+ if test x"${PYTHON2}" = "x:"; then
134+ PYTHONx=
132135 fi
136+ fi
137+ AC_CHECK_PROG ( [ PYTHONFOUND] ,[ ${PYTHONx}] ,[ yes] )
138+ if test x"${PYTHONFOUND}" != xyes; then
139+ AC_MSG_ERROR ( [ Python was not found. Please install Python3 (or Python2)] )
140+ fi
133141
134- PKGS=$(${PYTHON } -c 'import wheel; import pip' 2>/dev/null)
135- if test $? != 0; then
136- AC_MSG_ERROR ( [ ${PYTHON } does not have 'pip', 'setuptools' and 'wheel' installed] )
137- fi
138- AC_SUBST ( PYTHON , "${PYTHON }" )
142+ PKGS=$(${PYTHONx } -c 'import wheel; import pip' 2>/dev/null)
143+ if test $? != 0; then
144+ AC_MSG_ERROR ( [ ${PYTHONx } does not have 'pip', 'setuptools' and 'wheel' installed] )
145+ fi
146+ AC_SUBST ( PYTHONx , "${PYTHONx }" )
139147fi
140148AM_CONDITIONAL([ ENABLE_PYLIB] ,[ test x"${enable_pylib}" = xyes] )
141149
@@ -201,11 +209,15 @@ AC_DEFINE([LFR_VERSION_MN],[uninameslist_fr_revision])
201209
202210# -------------------------------------------
203211# Pass variables to build libuninameslist.pc
212+ rm -f libuninameslist.pc
204213uninameslist_libs="-luninameslist"
205- dnl if test x"${frenchlib}" = xtrue; then
206- dnl uninameslist_libs="${uninameslist_libs} -luninameslist-fr"
207- dnl fi
214+ uninameslist_libs_private=
215+ if test x"${frenchlib}" = xyes; then
216+ uninameslist_libs="-luninameslist -luninameslist-fr"
217+ uninameslist_libs_private="-luninameslist-fr"
218+ fi
208219AC_SUBST ( [ LIBUNINAMESLIST_PKGCONFIG_LIBS] ,[ "${uninameslist_libs}"] )
220+ AC_SUBST ( [ LIBUNINAMESLIST_PKGCONFIG_LIBS_PRIVATE] ,[ "${uninameslist_libs_private}"] )
209221
210222# -------------------------------------------
211223# Pass variables to MAKEFILE.AM
@@ -256,5 +268,5 @@ Configuration:
256268Optional:
257269 Include French C lib ${frenchlib}
258270 Build Python wheels ${enable_pylib}
259-
271+ Build wheels using ${PYTHONx}
260272] )
0 commit comments