>
> You changed from --enable to --with, but left the conditional name as
> ENABLE_GENLIB.  Change to WITH_GENLIB.
> Makefile.am:
> Don't test WITH_GENLIB twice.  Test it once and set all the variables
> there.  Move:
> +  AM_DLLTOOLFLAGS=-o $@
> and its twin into the respective conditional paths.  Move:
>  if DELAY_IMPORT_LIBS
>    AM_DLLTOOLFLAGS += --output-delaylib [email protected]
>  endif
> after the WITH_GENLIB conditional.

Yeah I knew I done that. I thought the variable name could have stayed the
same.
Laziness on my part there.

Anyway here is an updated patch to address your comments.
It is in .txt format :)

On Mon, Nov 9, 2015 at 11:47 PM, NightStrike <[email protected]> wrote:

> configure.ac:
>
> You missed AS_VAR_SET:
> [GENLIB=$with_genlib]
> [AS_VAR_SET([GENLIB], [$with_genlib])]
>
> This handles quoting very portably, and is more usable wrt indirection
> for when someone copies this code elsewhere to do a similar change.
>
> You also forgot to remove AC_SUBST, which is redundant with AC_CHECK_TOOL.
>
> You changed from --enable to --with, but left the conditional name as
> ENABLE_GENLIB.  Change to WITH_GENLIB.
>
> Makefile.am:
> Don't test WITH_GENLIB twice.  Test it once and set all the variables
> there.  Move:
>
> +  AM_DLLTOOLFLAGS=-o $@
>
> and its twin into the respective conditional paths.  Move:
>
>  if DELAY_IMPORT_LIBS
>    AM_DLLTOOLFLAGS += --output-delaylib [email protected]
>  endif
>
> after the WITH_GENLIB conditional.
>
>
> Send patches as .txt, as google screws up the encoding / mime type.
>
>
> On Tue, Nov 10, 2015 at 2:08 AM, Martell Malone <[email protected]>
> wrote:
> > Thanks for your input and help on this.
> > Please review :)
> >
> > On Sun, Nov 8, 2015 at 10:05 PM, NightStrike <[email protected]>
> wrote:
> >>
> >> ...and, as such, you have to provide a way to set the name.
> >> --with-genlib=mygenlib.  You can find examples of this elsewhere in
> >> the build system.  This means that you don't call AC_CHECK_TOOL until
> >> after the with- processing, and only if with_genlib is not set to no.
> >> AS_CASE is appropriate for that checking.
> >>
> >> On Mon, Nov 9, 2015 at 1:02 AM, NightStrike <[email protected]>
> wrote:
> >> > Sorry, missed this the first time around... this should be a with-
> >> > option, not enable.  genlib is an external tool for the crt, not an
> >> > internal feature that is getting compiled in.  You should just have to
> >> > change to AC_ARG_WITH and from enable_ to with_.
> >> >
> >> > On Mon, Nov 9, 2015 at 12:46 AM, Martell Malone
> >> > <[email protected]> wrote:
> >> >> Here is the final patch after running autoreconf -fi and only
> applying
> >> >> relevant changes.
> >> >> I would like to apply this if there are no objections ?
> >> >>
> >> >> Kind Regards
> >> >> Martell
> >> >>
> >> >> On Fri, Nov 6, 2015 at 3:39 PM, Martell Malone
> >> >> <[email protected]>
> >> >> wrote:
> >> >>>
> >> >>> Updated to reflect Nightstrike's feedback
> >> >>>
> >> >>> On Wed, Nov 4, 2015 at 2:00 PM, NightStrike <[email protected]>
> >> >>> wrote:
> >> >>>>
> >> >>>> Use AM_CONDITIONAL, not DEFINE_UNQUOTED
> >> >>>>
> >> >>>> On Wed, Nov 4, 2015 at 1:56 PM, Martell Malone
> >> >>>> <[email protected]>
> >> >>>> wrote:
> >> >>>> > Be warned I am no autotools expert.
> >> >>>> > A review would be very helpful. :)
> >> >>>> >
> >> >>>> > CC+ alexey for help on that :)
> >> >>>> >
> >> >>>> >
> >> >>>> >
> >> >>>> >
> >> >>>> >
> ------------------------------------------------------------------------------
> >> >>>> >
> >> >>>> > _______________________________________________
> >> >>>> > Mingw-w64-public mailing list
> >> >>>> > [email protected]
> >> >>>> > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >> >>>> >
> >> >>>>
> >> >>>>
> >> >>>>
> >> >>>>
> ------------------------------------------------------------------------------
> >> >>>> _______________________________________________
> >> >>>> Mingw-w64-public mailing list
> >> >>>> [email protected]
> >> >>>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >> >>>
> >> >>>
> >> >>
> >> >>
> >> >>
> >> >>
> ------------------------------------------------------------------------------
> >> >> Presto, an open source distributed SQL query engine for big data,
> >> >> initially
> >> >> developed by Facebook, enables you to easily query your data on
> Hadoop
> >> >> in a
> >> >> more interactive manner. Teradata is also now providing full
> enterprise
> >> >> support for Presto. Download a free open source copy now.
> >> >> http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
> >> >> _______________________________________________
> >> >> Mingw-w64-public mailing list
> >> >> [email protected]
> >> >> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Presto, an open source distributed SQL query engine for big data,
> >> initially
> >> developed by Facebook, enables you to easily query your data on Hadoop
> in
> >> a
> >> more interactive manner. Teradata is also now providing full enterprise
> >> support for Presto. Download a free open source copy now.
> >> http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
> >> _______________________________________________
> >> Mingw-w64-public mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > Mingw-w64-public mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
From add296c71b497f0a46c8ff135797f1e23dd873fb Mon Sep 17 00:00:00 2001
From: Martell Malone <[email protected]>
Date: Wed, 4 Nov 2015 18:47:54 +0000
Subject: [PATCH] configure.ac: add support for --with-genlib


diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index a137750..804b176 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -22,19 +22,29 @@ endif
 AM_CPPFLAGS=-D_CRTBLD $(sysincludes)
 AM_CFLAGS=-pipe -std=gnu99 -D_WIN32_WINNT=0x0f00 @ADD_C_CXX_WARNING_FLAGS@ 
@ADD_C_ONLY_WARNING_FLAGS@
 AM_CXXFLAGS=@ADD_C_CXX_WARNING_FLAGS@ @ADD_CXX_ONLY_WARNING_FLAGS@
-AM_DLLTOOLFLAGS=-k --as=$(AS) --output-lib $@
-if DELAY_IMPORT_LIBS
-  AM_DLLTOOLFLAGS += --output-delaylib [email protected]
-endif
 CPPFLAGSARM32=-mfpu=vfp
 CPPFLAGS32=-m32
 CPPFLAGS64=-m64
-DLLTOOLFLAGSARM32=
-DLLTOOLFLAGS32=--as-flags=--32 -m i386
-DLLTOOLFLAGS64=--as-flags=--64 -m i386:x86-64
-DTDEFARM32=$(DLLTOOL) $(DLLTOOLFLAGSARM32) $(AM_DLLTOOLFLAGS) --input-def
-DTDEF32=$(DLLTOOL) $(DLLTOOLFLAGS32) $(AM_DLLTOOLFLAGS) --input-def
-DTDEF64=$(DLLTOOL) $(DLLTOOLFLAGS64) $(AM_DLLTOOLFLAGS) --input-def
+if WITH_GENLIB
+  AM_DLLTOOLFLAGS=-o $@
+  DLLTOOLFLAGSARM32=-a arm
+  DLLTOOLFLAGS32=-a x86
+  DLLTOOLFLAGS64=-a x86_64
+  DTDEFARM32=$(GENLIB) $(DLLTOOLFLAGSARM32) $(AM_DLLTOOLFLAGS)
+  DTDEF32=$(GENLIB) $(DLLTOOLFLAGS32) $(AM_DLLTOOLFLAGS)
+  DTDEF64=$(GENLIB) $(DLLTOOLFLAGS64) $(AM_DLLTOOLFLAGS)
+else
+  AM_DLLTOOLFLAGS=-k --as=$(AS) --output-lib $@
+  DLLTOOLFLAGSARM32=
+  DLLTOOLFLAGS32=--as-flags=--32 -m i386
+  DLLTOOLFLAGS64=--as-flags=--64 -m i386:x86-64
+  DTDEFARM32=$(DLLTOOL) $(DLLTOOLFLAGSARM32) $(AM_DLLTOOLFLAGS) --input-def
+  DTDEF32=$(DLLTOOL) $(DLLTOOLFLAGS32) $(AM_DLLTOOLFLAGS) --input-def
+  DTDEF64=$(DLLTOOL) $(DLLTOOLFLAGS64) $(AM_DLLTOOLFLAGS) --input-def
+endif
+if DELAY_IMPORT_LIBS
+  AM_DLLTOOLFLAGS += --output-delaylib [email protected]
+endif
 DTLIBARM32=$(DTDEFARM32) $(top_srcdir)/`echo $@ | $(SED) 
's|/lib|/|;s|\.a|.def|'`
 DTLIB32=$(DTDEF32) $(top_srcdir)/`echo $@ | $(SED) 's|/lib|/|;s|\.a|.def|'`
 DTLIB64=$(DTDEF64) $(top_srcdir)/`echo $@ | $(SED) 's|/lib|/|;s|\.a|.def|'`
diff --git a/mingw-w64-crt/Makefile.in b/mingw-w64-crt/Makefile.in
index d823038..f86cccc 100644
--- a/mingw-w64-crt/Makefile.in
+++ b/mingw-w64-crt/Makefile.in
@@ -4947,6 +4947,7 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
+GENLIB = @GENLIB@
 GREP = @GREP@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -5039,16 +5040,24 @@ top_srcdir = @top_srcdir@
 AM_CPPFLAGS = -D_CRTBLD $(sysincludes)
 AM_CFLAGS = -pipe -std=gnu99 -D_WIN32_WINNT=0x0f00 @ADD_C_CXX_WARNING_FLAGS@ 
@ADD_C_ONLY_WARNING_FLAGS@
 AM_CXXFLAGS = @ADD_C_CXX_WARNING_FLAGS@ @ADD_CXX_ONLY_WARNING_FLAGS@
-AM_DLLTOOLFLAGS = -k --as=$(AS) --output-lib $@ $(am__append_1)
 CPPFLAGSARM32 = -mfpu=vfp
 CPPFLAGS32 = -m32
 CPPFLAGS64 = -m64
-DLLTOOLFLAGSARM32 = 
-DLLTOOLFLAGS32 = --as-flags=--32 -m i386
-DLLTOOLFLAGS64 = --as-flags=--64 -m i386:x86-64
-DTDEFARM32 = $(DLLTOOL) $(DLLTOOLFLAGSARM32) $(AM_DLLTOOLFLAGS) --input-def
-DTDEF32 = $(DLLTOOL) $(DLLTOOLFLAGS32) $(AM_DLLTOOLFLAGS) --input-def
-DTDEF64 = $(DLLTOOL) $(DLLTOOLFLAGS64) $(AM_DLLTOOLFLAGS) --input-def
+@WITH_GENLIB_FALSE@AM_DLLTOOLFLAGS = -k --as=$(AS) --output-lib $@ \
+@WITH_GENLIB_FALSE@    $(am__append_1)
+@WITH_GENLIB_TRUE@AM_DLLTOOLFLAGS = -o $@ $(am__append_1)
+@WITH_GENLIB_FALSE@DLLTOOLFLAGSARM32 = 
+@WITH_GENLIB_TRUE@DLLTOOLFLAGSARM32 = -a arm
+@WITH_GENLIB_FALSE@DLLTOOLFLAGS32 = --as-flags=--32 -m i386
+@WITH_GENLIB_TRUE@DLLTOOLFLAGS32 = -a x86
+@WITH_GENLIB_FALSE@DLLTOOLFLAGS64 = --as-flags=--64 -m i386:x86-64
+@WITH_GENLIB_TRUE@DLLTOOLFLAGS64 = -a x86_64
+@WITH_GENLIB_FALSE@DTDEFARM32 = $(DLLTOOL) $(DLLTOOLFLAGSARM32) 
$(AM_DLLTOOLFLAGS) --input-def
+@WITH_GENLIB_TRUE@DTDEFARM32 = $(GENLIB) $(DLLTOOLFLAGSARM32) 
$(AM_DLLTOOLFLAGS)
+@WITH_GENLIB_FALSE@DTDEF32 = $(DLLTOOL) $(DLLTOOLFLAGS32) $(AM_DLLTOOLFLAGS) 
--input-def
+@WITH_GENLIB_TRUE@DTDEF32 = $(GENLIB) $(DLLTOOLFLAGS32) $(AM_DLLTOOLFLAGS)
+@WITH_GENLIB_FALSE@DTDEF64 = $(DLLTOOL) $(DLLTOOLFLAGS64) $(AM_DLLTOOLFLAGS) 
--input-def
+@WITH_GENLIB_TRUE@DTDEF64 = $(GENLIB) $(DLLTOOLFLAGS64) $(AM_DLLTOOLFLAGS)
 DTLIBARM32 = $(DTDEFARM32) $(top_srcdir)/`echo $@ | $(SED) 
's|/lib|/|;s|\.a|.def|'`
 DTLIB32 = $(DTDEF32) $(top_srcdir)/`echo $@ | $(SED) 's|/lib|/|;s|\.a|.def|'`
 DTLIB64 = $(DTDEF64) $(top_srcdir)/`echo $@ | $(SED) 's|/lib|/|;s|\.a|.def|'`
diff --git a/mingw-w64-crt/configure b/mingw-w64-crt/configure
index 55be464..77d0766 100755
--- a/mingw-w64-crt/configure
+++ b/mingw-w64-crt/configure
@@ -644,6 +644,9 @@ DELAY_IMPORT_LIBS_FALSE
 DELAY_IMPORT_LIBS_TRUE
 PRIVATE_EXPORTS_FALSE
 PRIVATE_EXPORTS_TRUE
+WITH_GENLIB_FALSE
+WITH_GENLIB_TRUE
+GENLIB
 LIBARM32SUFFIXDIR
 LIBARM64SUFFIXDIR
 LIBX8632SUFFIXDIR
@@ -781,6 +784,7 @@ enable_w32api
 enable_lib32
 enable_lib64
 enable_libarm32
+with_genlib
 enable_wildcard
 enable_private_exports
 enable_delay_import_libs
@@ -1452,6 +1456,8 @@ Optional Packages:
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-sysroot=DIR      Search for headers within DIR/include (default:
                           prefix)
+  --with-genlib=PATH      Whether to build import libraries via the genlib
+                          tool (default: no)
 
 Some influential environment variables:
   CC          C compiler command
@@ -5476,6 +5482,126 @@ LIBARM32SUFFIXDIR=$libarm32suffx
 
 # Checks for features.
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use genlib" >&5
+$as_echo_n "checking whether to use genlib... " >&6; }
+
+# Check whether --with-genlib was given.
+if test "${with_genlib+set}" = set; then :
+  withval=$with_genlib;
+else
+  with_genlib=no
+fi
+
+case $with_genlib in #(
+  yes) :
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}genlib", so it can be a 
program name with args.
+set dummy ${ac_tool_prefix}genlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GENLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$GENLIB"; then
+  ac_cv_prog_GENLIB="$GENLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GENLIB="${ac_tool_prefix}genlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" 
>&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+GENLIB=$ac_cv_prog_GENLIB
+if test -n "$GENLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENLIB" >&5
+$as_echo "$GENLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_GENLIB"; then
+  ac_ct_GENLIB=$GENLIB
+  # Extract the first word of "genlib", so it can be a program name with args.
+set dummy genlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_GENLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_GENLIB"; then
+  ac_cv_prog_ac_ct_GENLIB="$ac_ct_GENLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_GENLIB="genlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" 
>&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_GENLIB=$ac_cv_prog_ac_ct_GENLIB
+if test -n "$ac_ct_GENLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GENLIB" >&5
+$as_echo "$ac_ct_GENLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_GENLIB" = x; then
+    GENLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not 
prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" 
>&2;}
+ac_tool_warned=yes ;;
+esac
+    GENLIB=$ac_ct_GENLIB
+  fi
+else
+  GENLIB="$ac_cv_prog_GENLIB"
+fi
+ ;; #(
+  no) :
+     ;; #(
+  *) :
+    GENLIB=$with_genlib ;;
+esac
+ if ${GENLIB+:} false; then
+  WITH_GENLIB_TRUE=
+  WITH_GENLIB_FALSE='#'
+else
+  WITH_GENLIB_TRUE='#'
+  WITH_GENLIB_FALSE=
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_genlib" >&5
+$as_echo "$with_genlib" >&6; }
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable globbing" 
>&5
 $as_echo_n "checking whether to enable globbing... " >&6; }
 # Check whether --enable-wildcard was given.
@@ -6183,6 +6309,10 @@ if test -z "${LIBARM32_TRUE}" && test -z 
"${LIBARM32_FALSE}"; then
   as_fn_error $? "conditional \"LIBARM32\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${WITH_GENLIB_TRUE}" && test -z "${WITH_GENLIB_FALSE}"; then
+  as_fn_error $? "conditional \"WITH_GENLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${PRIVATE_EXPORTS_TRUE}" && test -z "${PRIVATE_EXPORTS_FALSE}"; 
then
   as_fn_error $? "conditional \"PRIVATE_EXPORTS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/mingw-w64-crt/configure.ac b/mingw-w64-crt/configure.ac
index 788779c..b088953 100644
--- a/mingw-w64-crt/configure.ac
+++ b/mingw-w64-crt/configure.ac
@@ -161,6 +161,19 @@ AC_SUBST([LIBARM32SUFFIXDIR],[$libarm32suffx])
 
 # Checks for features.
 
+AC_MSG_CHECKING([whether to use genlib])
+AC_ARG_WITH([genlib],
+  [AS_HELP_STRING([--with-genlib=PATH],
+    [Whether to build import libraries via the genlib tool (default: no)])],
+  [],
+  [with_genlib=no])
+AS_CASE([$with_genlib],
+  [yes],[AC_CHECK_TOOL([GENLIB], [genlib], [:])],
+  [no],[],
+  [AS_VAR_SET([GENLIB], [$with_genlib])])
+AM_CONDITIONAL([WITH_GENLIB], [AS_VAR_TEST_SET([GENLIB])])
+AC_MSG_RESULT([$with_genlib])
+
 AC_MSG_CHECKING([whether to enable globbing])
 AC_ARG_ENABLE([wildcard],
   [AS_HELP_STRING([--enable-wildcard],
-- 
2.6.2

------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to