Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstraping issues #4

Closed
andreygursky opened this issue Oct 5, 2012 · 4 comments
Closed

Bootstraping issues #4

andreygursky opened this issue Oct 5, 2012 · 4 comments
Assignees

Comments

@andreygursky
Copy link

Hi Pete,

I've discovered some minor issues:

  1. Missing autogen.sh in git zipball due to
    libwdi / .gitattributes:
*.sh            export-ignore
  1. IMHO there can't be good default arguments for ./configure, that's why it shouldn't be called in autogen.sh
  2. One can call configure from arbitrary directory, specifying e.g. --with-libusb0=relative_path_to_libusb0. The configure script should get the absolute path to this directory, not just set LIBUSB0_DIR to it. Something like that:
AC_ARG_WITH([libusb0],
    [AS_HELP_STRING([--with-libusb0], [embed libusb0 driver files from the following location])],
-   [LIBUSB0_DIR=$withval],
+   [LIBUSB0_DIR=`readlink -m $withval`],
    [LIBUSB0_DIR=""])
if test "x$LIBUSB0_DIR" != "x"; then
    AC_DEFINE_UNQUOTED([LIBUSB0_DIR], ["${LIBUSB0_DIR}"], [embed libusb0 driver files from the following location])
fi

The same for DDK_DIR, LIBUSBK_DIR, USER_DIR.
TODO:
-check on windows and mingw (on windows).
-Ideally, the relative path from $top_srcdir/libwdi to $withval should be used.

@ghost ghost assigned pbatard Oct 6, 2012
@pbatard
Copy link
Owner

pbatard commented Oct 6, 2012

Thanks Andrey.

  1. Good point. libwdi/git was hosted on sourceforge prior to that, so that wasn't an issue. Now, my problem is I use the export-ignore because I use git export when generating the official source tarballs, and I don't want them to contain autogen.sh, since configure will have been generated. I'll try to figure out something to keep both git tarball and officiall tarball users happy.
  2. There are good default arguments to configure: the ones I use on my development platform! So these are the ones I set as default. If I didn't do that, I'd have to run configure manually, and with autotools being so slow on Windows compared to Linux (about 10x slower!), I want to have a one "run and forget" command that will get me to the makefile. But I understand your point, and the way we solved that for libusbx (where a similar case was made) was to have both a bootstrap.sh, that doesn't invoke configure, and an an autogen.sh that does. I'm planning to do the same for libwdi.
  3. I'll look into it, but I want to make sure this won't create issue on MinGW. By the way, if you feel like sending a patch for that, I'll be more than happy to test and apply it.

I'll keep this issue open for now, and close it once the 3 issues you mentioned have been addressed. Thanks a lot for the report!

@andreygursky
Copy link
Author

Yeah, bootstrap.sh for other is what we need.

and with autotools being so slow on Windows compared to Linux (about 10x slower!)

I think it is because it invokes compiler and even worse linker for almost every check, isn't it?

Regarding 3, here is a better proposal:

AC_ARG_WITH([libusb0],
    [AS_HELP_STRING([--with-libusb0], [embed libusb0 driver files from the following location])],
-   [LIBUSB0_DIR=$withval],
+        [case "$withval" in
+#in case of absolute path, leave it as is
+                /* | [[A-Za-z]]:[[\\/]]*) LIBUSB0_DIR="$withval"
+                        ;;
+#we're in the top_builddir, but LIBUSB0_DIR is used from from $top_builddir/libwdi,
+#that's why if the given path is relative, it should be prepended with ..
+                *) LIBUSB0_DIR="../$withval"
+                        ;;
+         esac],
    [LIBUSB0_DIR=""])
if test "x$LIBUSB0_DIR" != "x"; then
    AC_DEFINE_UNQUOTED([LIBUSB0_DIR], ["${LIBUSB0_DIR}"], [embed libusb0 driver files from the following location])
fi

@pbatard
Copy link
Owner

pbatard commented Oct 10, 2012

Thanks. I'll try to integrate your patch (which looks OK to me at first glance) as soon as I can, but it might take a few weeks before I am able to do so.

@pbatard
Copy link
Owner

pbatard commented Nov 14, 2012

For the record, I have added a bootstrap.sh in 9a40253. That should take care of step 2. I'll try to deal with 3. soon...ish. 1. might be a while.

@pbatard pbatard closed this as completed in 9b3c35e Sep 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants