Path to AutoRegen.sh

Hello, people

I'm developing a small code analysis project with LLVM (I hope I can
concentrate on it next semester and make it a really functional tool,
but, for now, it's an college end course project, and I'm more focused
on theoretical issues than on the implementation).

I'm using Ubuntu Linux and had a lot of trouble starting the project by
copping the "sample project". Finally, I've figured out the problem and
made a small patch to "AutoRegen.sh" in samples directory, to address
two issues:

* I'm using Autoconf 2.61, and it is compatible with the syntax used
  by LLVM, but AutoRegen.sh insists I need 2.5x.

* There is a bug in the AutoRegen.sh that appears when you try to
  regenerate configure scripts for your project outside the LLVM
  source tree: an shell "read" command missing a parameter.

The patch was tested on 2.2, but I think it will work to 2.3 too!

By the way, thank you for the hard work on LLVM. It's amazing!

Alexandre Machado

AutoRegen.sh.patch (2.78 KB)

Hi,

I think I have quite an identical patch lying around somewhere here, but I
thought that the AutoRegen.sh was something someone wrote here in-house, so I
never bothered to send it somewhere.

I do remember someone saying (on this list) one should really not use another
version of autoconf, but in my experience 2.6 works just as fine for building
an addon project (but perhaps not for rebuilding the entire llvm project).

The read errors are caused by ubuntu using dash instead of bash as the default
sh implementation, which does not assume REPLY when no variable is given.

Lastly, you might want to submit the patch by running diff -u, the diff you
generated is rather hard to read.

Gr.

Matthijs

* I'm using Autoconf 2.61, and it is compatible with the syntax used
by LLVM, but AutoRegen.sh insists I need 2.5x.

* There is a bug in the AutoRegen.sh that appears when you try to
regenerate configure scripts for your project outside the LLVM
source tree: an shell "read" command missing a parameter.

The patch was tested on 2.2, but I think it will work to 2.3 too!

By the way, thank you for the hard work on LLVM. It's amazing!

Some comments:
- Please follow the developers policy for making patches:
http://llvm.org/docs/DeveloperPolicy.html#patches

- I think if we are going to upgrade, we should totally switch to 2.6 instead of allowing both. This will make diffs easier to read when people regenerate the configure script.

- Did you read autoconf/README.txt? Were there no changes to the m4 macros or configure.ac?

- You should also regenerate the configure script as part of this patch.

- Does libtool also have to be upgraded?

- Lastly, I think we should postpone applying this patch until after the 2.3 branch creation. I'm leary of making tool changes so close to the release.

-Tanya

Hy, Tanya

Some comments:
- Please follow the developers policy for making patches:
http://llvm.org/docs/DeveloperPolicy.html#patches

OK. My fault here. Will check some of your observations and resubmit.

- I think if we are going to upgrade, we should totally switch to 2.6
instead of allowing both. This will make diffs easier to read when people
regenerate the configure script.

Agree... but we must be sure if it does not brake anything. I'm running
out of time with the current project, but, after it finishes, can look
to.

- Did you read autoconf/README.txt? Were there no changes to the m4
macros or configure.ac?

Well... at least there where no changes in macros used by the sample
project. But, if we are meant to migrate the whole LLVM to 2.6, I need
to investigate it further.

- You should also regenerate the configure script as part of this patch.

Ok.

- Does libtool also have to be upgraded?

Don't know. I'm using 1.5.24, but don't know if it will work with other
versions. It's another think I need to check.

- Lastly, I think we should postpone applying this patch until after the
2.3 branch creation. I'm leary of making tool changes so close to the
release.

Agree. Sent it just because, as a beginner with LLVM, it was a pain to
start a new project in my environment, and I know there are a lot of
other ubuntu users out there, but it's not necessary to hurry.

-Tanya

Thanks

Alexandre

Hi, Matthijs

Tanya addressed some of these issues on her response to my patch. You
can see there some comments.

Thanks about the ubuntu 'dash' issue. Never minded which shell I was
using here... it's very like bash from user viewpoint. I think it's
another reason to have the variable on the command line.

Alexandre

Thanks about the ubuntu 'dash' issue. Never minded which shell I was
using here... it's very like bash from user viewpoint. I think it's
another reason to have the variable on the command line.

It seems that even with adding the REPLY variable name, the script isn't as
portable as it could/should be (posix [1] doesn't support the -p option).
Still adding REPLY to the read calls will make the script work on distro's
using dash (at least Ubuntu).

Gr.

Matthijs

[1]: http://www.opengroup.org/onlinepubs/009695399/utilities/read.html

Hy, Tanya

Some comments:
- Please follow the developers policy for making patches:
http://llvm.org/docs/DeveloperPolicy.html#patches

OK. My fault here. Will check some of your observations and resubmit.

- I think if we are going to upgrade, we should totally switch to 2.6
instead of allowing both. This will make diffs easier to read when people
regenerate the configure script.

Agree... but we must be sure if it does not brake anything. I'm running
out of time with the current project, but, after it finishes, can look
to.

- Did you read autoconf/README.txt? Were there no changes to the m4
macros or configure.ac?

Well... at least there where no changes in macros used by the sample
project. But, if we are meant to migrate the whole LLVM to 2.6, I need
to investigate it further.

Ah, my fault. I thought you were talking about the top level AutoRegen.h. This is probably much simpler then. LLVM already uses 2.6 :slight_smile:

- You should also regenerate the configure script as part of this patch.

Ok.

Ignore this too. No configure to regenerate.

- Does libtool also have to be upgraded?

Don't know. I'm using 1.5.24, but don't know if it will work with other
versions. It's another think I need to check.

- Lastly, I think we should postpone applying this patch until after the
2.3 branch creation. I'm leary of making tool changes so close to the
release.

Agree. Sent it just because, as a beginner with LLVM, it was a pain to
start a new project in my environment, and I know there are a lot of
other ubuntu users out there, but it's not necessary to hurry.

I'll see about getting this integrated after 2.3. Thanks!

-Tanya